This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.registerMultiTask('write-component', 'write new files to component.json file list', function() { | |
var componentFile = grunt.file.readJSON('component.json') | |
componentFile.scripts = this.files[0].src | |
grunt.file.write('component.json', JSON.stringify(componentFile, null, 2)) | |
}) | |
grunt.initConfig({ | |
"write-component": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<x-physics-boundry constant-acceleration-x="1000"> | |
<x-physics-body fix-y> | |
<div class="menu">All your menu stuff</div> | |
</ul> | |
</x-physics-boundry> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("deviceready", onDeviceReady, false); | |
function onDeviceReady(){ | |
console.log('onDeviceReady()'); | |
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, function() { console.log('FAIL - window.requestFileSystem'); } ); | |
} | |
// var mediaEncoded; | |
function gotFS (fileSystem) { | |
console.log("GotFS()"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var boundry = Physics.Boundry(0, 0, height, width) | |
var draggable = drag({ boundryDamping: .2 }).bounds(boundry) | |
var decelerate = phys.decelerate({ deceleration: 1000 }).bounds(boundry).start | |
var spring = phys.spring({ deceleration: 1000 }).start | |
draggable.pipe(phys) | |
draggable.start() | |
.then(decelerate) | |
.then(spring) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
dig google.com | |
sleep 240 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec | |
var browsers = { chrome: 'Google\\ Chrome.app', firefox: 'Firefox.app', safari: 'Safari.app' } | |
function openInBrowser(browser) { | |
exec("open -a " + browsers[browser]) | |
} | |
openInBrowser('safari') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f(x) { | |
x = ((((x + 2) % 4) + 4) % 4) - 2 | |
if(x > 1) return 360 - Math.acos(2 - x) * (180/Math.PI) | |
if(x < -1) return 360 - Math.acos(-2 - x) * (180/Math.PI) | |
return Math.acos(x) * (180/Math.PI) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.oldWS = window.WebSocket | |
window.sockets = [] | |
window.WebSocket = function() { | |
var ws = oldWS.apply(this, arguments); | |
window.sockets.push(ws); | |
return ws; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash' | |
function ooify(fn) { | |
return function() { | |
return fn.apply(this, [this].concat([].slice.call(arguments))) | |
} | |
} | |
var methods = _.zipObject(_.map(_.keys(_.prototype), methodName => { | |
return [methodName, ooify(_[methodName])] | |
})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am xcoderzach on github. | |
* I am zachs (https://keybase.io/zachs) on keybase. | |
* I have a public key whose fingerprint is F5FC 7CF2 538F FF50 DB0F D6CA 7166 7314 0CB9 EC15 | |
To claim this, I am signing this object: |