#Basic Stuff#
##Movements##
- Goto next word w
- Goto previous word b
- Select inner word viw
- Select the inner block - vi{
- Go to closing or opening tag - %
a=[10,20,30,40,50] | |
a.each_index {|i| if a[i] > 20 | |
return i | |
} |
# Main sinatra app | |
require 'sinatra' | |
require 'activerecord' | |
require 'activesupport' | |
include ActionView::Helpers::DateHelper # add the required helpers here. | |
require 'controllers.rb' | |
# controllers.rb |
#Basic Stuff#
##Movements##
class Item | |
attr_reader :id | |
def initialize(id, properties) | |
@id = id | |
@properties = properties | |
end | |
def method_missing(m, *args, &block) | |
@properties[m] |
# to test, run this file and `nc localhost 34242`, type a line and press enter | |
require 'webrick' | |
s = WEBrick::GenericServer.new(:Port => 34242) | |
trap("INT") { s.shutdown } | |
s.start do |sock| | |
begin | |
incoming=sock.readline | |
rescue EOFError => err | |
break |
manycopies init manycopies add volume /Volumes/My500GBPassport Rainmaker manycopies add volume /Volumes/OldSeagate80 Coconut manycopies add temporary volume / "MBP-Retina-temp"
manycopies ln "/Users/jasim/Pictures/Downloaded Albums/106517555286564995482" /Photos manycopies ln /Volumes/My500GBPassport/ManyCopies /
manycopies set sync /Photos /Documents Rainmaker manycopies set sync /Photos /Documents Coconut
class PhysicalStorageVolume | |
OS_VERSION = RbConfig::CONFIG['host_os'] | |
def initialize(path) | |
@path = path | |
@path_exists = File.exists?(path) | |
end | |
def raise_error_if_file_doesnt_exist! | |
raise Errno::ENOENT.new(@path) unless @path_exists |
bungstart() | |
bungoption("Files") | |
bungdrop() | |
bungoption("Open" ,{} ,{||!lFileIsOpen} ) | |
bungoption("Close",{||nil},{||lFileIsOpen } ) | |
bungundrop() | |
bungoption("Edit") | |
bungdrop() | |
bungoption("DBF" ,{||nil},nil ) | |
bungoption("Ascii",{||nil},nil ) |
var ngAppElem = angular.element(document.querySelector('[ng-app]') || document); | |
window.injector = ngAppElem.injector(); | |
window.inject = injector.invoke; | |
window.$rootScope = ngAppElem.scope(); | |
Object.defineProperty(window, '$scope', { | |
get: function () { | |
var elem = angular.element(console._commandLineAPI.$0); | |
return elem.isolateScope() || elem.scope(); |
Mike McNeil, Aug 2014
Humans are not very good at planning. We have no problem running scenarios, thinking through possibilities, and pondering "what if?" questions. I might plan to not eat my cousin's birthday cake before she gets home, for instance. If I'm very serious, I might write down my commitment; or if I'm unsure about the pros and cons, use some organizational tool like a T-chart.
But when it comes to making a decision in the moment, all bets are off. The cake is a goner.
Below, I've included a figure containing a decision tree diagram.