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
layoutElement.addEventListener("touchstart", handleStart, false); | |
layoutElement.addEventListener("touchmove", handleMove, false); | |
layoutElement.addEventListener("touchend", handleEnd, false); | |
function handleStart(event) { | |
event.preventDefault(); | |
var touches = event.changedTouches; | |
for (var i=0; i<touches.length; i++) { | |
Header.onDragStart({ |
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 Animal = { | |
walk: function() { | |
console.log('walk'); | |
}, | |
talk: function() { | |
console.log('talk'); | |
} | |
}; | |
function Dog() { | |
this.talk = function() { |
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
require 'fileutils' | |
FileUtils::mkdir_p Rails.root + 'public/foo/bar' |
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
#!/usr/bin/python | |
import sys | |
# @author Lee Hunter | |
# @email wleehunter@gmail.com | |
# @prerequisites: python version 2.5 or higher (I think) | |
# @usage: python lightspuzzler.py <number_of_lights> | |
# @example: python lightspuzzler.py 20000 (This would give the results from the actual question. It will also take forever) | |
# short, messy script to calculate which lights would remain on given the scenario described by Click and Clack. |
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
#!/usr/bin/python | |
# Based on example here: http://www.algolist.net/Algorithms/Sorting/Quicksort | |
def partition(numList, left, right, side): | |
i = left | |
j = right | |
tmp = None | |
pivot = numList[(left+right) / 2] | |
print "Beginning " + side + " partition" |
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
Timeout.timeout(0.5) { TCPSocket.open("localhost", 6379) { } } |
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
/** | |
@param String - text to rotate | |
@param Number - time to complete one rotation (in milliseconds) | |
@param String - axis to rotate about | |
Usage: | |
text_rotate("My text to rotate", 1000, "x"); | |
*/ | |
function text_rotate(text,time,axis){ | |
var d=l=""; |
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
{ | |
"detect_indentation": false, | |
"draw_white_space": "all", | |
"font_size": 15.0, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true |
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 FacebookLogin= { | |
APPID: null, | |
connected: false, | |
accessToken: null, | |
loginResponse: null, | |
signedRequest: null, | |
userID: null, | |
$loginLink: null, | |
$logoutLink: null, |
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
# disable auto rotation | |
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0 | |
# force landscape | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1 | |
# back to portrait | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0 | |
# upside down |
OlderNewer