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
$('body').css('-webkit-transition', '-webkit-transform 0.8s'); | |
i=0; | |
setInterval(function(){ | |
i += 360 | |
$('body').css("-webkit-transform","rotate("+ i +"deg)")} | |
,800) |
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
sudo npm install -g cordova | |
npm install -g ios-sim | |
npm install -g ios-deploy | |
cordova create hello com.example.hello HelloWorld | |
cd hello | |
cordova platform add ios | |
cordova build | |
cordova emulate ios | |
cordova run ios |
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 window.recordSignals | |
@recorded ?= [] | |
@recorded.push {signal, cb} | |
window.playbackSignals = -> | |
i = 0 | |
window.recordSignals = false | |
for item, i in devApp.scraper.recorded then do (item, i) -> | |
{signal, cb} = item | |
setTimeout -> |
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
$.ajax(url: "https://api.github.com/users/captainclam/gists").done (gists) -> | |
$('.public-gists').empty() | |
for gist in gists then do (gist) -> | |
{id, description, html_url, created_at} = gist | |
a = $('<a>') | |
a.attr 'href', html_url | |
a.text description | |
li = $ '<li>' | |
li.append created_at.substr(0, 10) + ': ' | |
li.append a |
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
on alfred_script(q) | |
tell application "Safari" | |
activate | |
delay 0.5 | |
tell application "System Events" | |
tell process "Safari" | |
set frontmost to true | |
try | |
click menu item 2 of menu 1 of menu item "iOS Simulator" of menu 1 of menu bar item "Develop" of menu bar 1 | |
end try |
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
find . -type f -name '*.js' | while read f; do echo "grinding $f to ${f/.js/.coffee} "; js2coffee "$f" > "${f/.js/.coffee}"; done | |
find . -type f -name '*.js' | while read f; do echo "deleting $f "; rm $f; do |
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
exports.Router = Backbone.Router.extend | |
routes: | |
'home': 'home' | |
'login': 'login' | |
'profile': 'profile' | |
'logout': 'logout' | |
'search/:query': 'search' | |
home: -> | |
console.log 'router:home' |
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
link = $('<link>') | |
link.attr | |
href: $('#cdn').val() + '/casino/' + $('#shortName').val() + '/stylesheets/main.css' | |
rel: 'stylesheet' | |
id: 'mainStylesheet' | |
$('head').append link |
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
# text, select | |
$('input[type=text].persist').each -> | |
id = $(this).attr('id') | |
val = localStorage.getItem(id) | |
$(this).val(val) | |
$('input[type=text].persist').change -> | |
id = $(this).attr('id') | |
val = $(this).val() | |
localStorage.setItem(id, val) |
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
retrieve = (k) -> JSON.parse localStorage.getItem k | |
store = (k, v) -> localStorage.setItem k, JSON.stringify v | |
store 'name', 'simon' | |
store 'age', 28 | |
store 'list', [1, 2, 3] | |
store 'happy', true | |
console.log retrieve 'list' |
OlderNewer