This file contains 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 writeData = function (filename, data, callback) { | |
var writeOutData = function () { | |
var fw = new FileWriter(); | |
fw.oncomplete = callback; | |
fw.onerror = function () { | |
alert("Failed to save update"); | |
} | |
fw.writeAsText("myDir/" + filename, data); | |
} | |
This file contains 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
<html> | |
<h1>Playing Audio</h1> | |
<button onclick="playAudio('brobob.mp3')">Play Some Audio</button> | |
<script src="phonegap.js"></script> | |
<script> | |
function playAudio(src) { | |
if (device.platform == 'Android') { | |
src = '/android_asset/www/' + src; | |
} |
This file contains 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 Hogan = require('./twitter-hogan'); | |
var renderOptions = { asString: true, sectionTags: [{ o: '_i', c: 'i' }] }; | |
var translateMustache = require('./translate-mustache'); | |
function extractPartials(tmpl) { | |
// need eval to pull the partials out of the Hogan-generated string | |
/* eslint-disable no-eval */ | |
var hoganParams = eval(`(${tmpl})`); | |
/* eslint-enable no-eval */ | |
var partialNames = []; |
This file contains 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
// use with http://defunkt.io/dotjs/ | |
$('.unread_count') | |
.hide() |
This file contains 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 _ = require('i18n_library'); | |
modules.exports = { | |
literalPhrase: "Hola Sean", | |
parameterizedPhrase: _("Hola {{person}}", { person: "Sean" }) | |
} |
This file contains 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
<html> | |
<body> | |
<form onsubmit="return saveText()"> | |
<label for="name">Name</label><br> | |
<input id="name" /><br> | |
<label for="desc">Description</label><br> | |
<input id="desc" /><br> | |
<input type="submit" value="Save" /> |
This file contains 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
spymaster: PropTypes.bool.isRequired, | |
double: PropTypes.string, | |
toggleSpymaster: PropTypes.func | |
} | |
window.addEventListener('deviceorientation', this.onDeviceOrientation) | |
} |
This file contains 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
$ npm install | |
> fsevents@1.0.9 install /Users/alunny/dev/tmp/rq/node_modules/fsevents | |
> node-pre-gyp install --fallback-to-build | |
[fsevents] Success: "/Users/alunny/dev/tmp/rq/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" is installed via remote | |
require-from-twitter@0.0.1 /Users/alunny/dev/tmp/rq | |
├─┬ babel-cli@6.6.5 | |
│ ├─┬ babel-polyfill@6.7.4 | |
│ │ ├── babel-regenerator-runtime@6.5.0 |
This file contains 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
if (value === 'onething') { | |
return correctValue; | |
} else { | |
omfg.this.should.never.happen | |
} |
This file contains 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
#!/bin/bash | |
while true | |
do | |
curl http://eztv.it | grep "href=\"\/ep\/.*\/masterchef" | |
if [ $? -ne 0 ] | |
then | |
echo "not found at `date`" | |
sleep 30 | |
else |
NewerOlder