vi /usr/local/Library/brew.rb
Change line 1 from:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
to:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
Save and exit
| $.event.special['click:fast'] = { | |
| propagate: true, | |
| add: function(handleObj) { | |
| var getCoords = function(e) { | |
| if ( e.touches && e.touches.length ) { | |
| var touch = e.touches[0]; | |
| return { | |
| x: touch.pageX, | |
| y: touch.pageY |
| #!/bin/bash | |
| git add . | |
| git commit -am 'master deploy' | |
| git checkout gh-pages | |
| git checkout master -- dist | |
| rsync -a -v dist/ ./ | |
| rm -rf dist | |
| git add . | |
| git commit -am 'page deploy' | |
| git push |
| // example: | |
| // var stateHandler = State(node, function(state) { this.className = state.active ? 'active' : '' }) | |
| // stateHandler.set({ active: true }) | |
| var states = {} | |
| function State(elem, render) { | |
| if ( states.hasOwnProperty(elem) ) | |
| return states[elem] | |
| if ( !(this instanceof State) ) { | |
| var instance = new State(elem, render) |
vi /usr/local/Library/brew.rb
Change line 1 from:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
to:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
Save and exit
sudo mkdir -p /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp}/
sudo ln -s /opt/X11 /usr/X11
| xcode-select --install |
| var keys = [37, 38, 39, 40] | |
| var prevent = (e) => { | |
| if ( e.type != 'keydown' || keys.indexOf(e.keyCode) != -1 ) { | |
| e.preventDefault() | |
| return false | |
| } | |
| } | |
| var disableScroll = (node) => { | |
| node = node || window | |
| node.onwheel = node.ontouchmove = document.onkeydown = prevent |
| findKey = (haystack, needle) => { | |
| let found = false | |
| const iterate = (obj) => ( | |
| Object.keys(obj).forEach((key) => { | |
| if (found === false) { | |
| if (key === needle) { | |
| found = key | |
| } else if (obj[key] && typeof obj[key] === 'object') { | |
| iterate(obj[key]) | |
| } |
| <html> | |
| <head> | |
| <style> | |
| #content{height: 8000px; width: 800px; margin: 0 auto; background: yellow;position: relative;} | |
| </style> | |
| </head> | |
| <body> | |
| <div id="content"> | |
| Lorem<br> | |
| Lorem<br> |