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
<canvas id='canvas'></canvas> | |
<!-- | |
Concentrics: A little Canvas + Javascript experiment by @twholman | |
Experiment + controls @ http://tholman.com/experiments/html5/concentrics | |
--> |
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
alias dbreset='rake db:drop; rake db:create; rake db:migrate; rake db:seed; rake db:test:prepare' | |
alias dbupdate='rake db:migrate; rake db:seed; rake db:test:prepare' | |
alias gcall='git add .; git commit -am' |
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 hello() { | |
return { | |
a: 2 | |
}; | |
} | |
function hello2() { | |
return | |
{ | |
a: 2 |
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 string | |
def pretty_size(size): | |
"size in bytes" | |
size = int(size) | |
units = ' KMGTPE'+string.lowercase[::-1] | |
bytes = 'B' | |
i = 0 | |
while size>1024: |
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
cd ~/raspi | |
git clone https://github.com/raspberrypi/linux.git | |
wget http://xecdesign.com/downloads/linux-qemu/linux-arm.patch | |
patch -p1 -d linux/ < linux-arm.patch | |
cd ~/raspi/linux | |
make ARCH=arm versatile_defconfig |
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
// control intensity of LED using serial communication | |
int incomingByte = 0; // for incoming serial data | |
int outVal = 0; // for signal out | |
int pwmPin = 6; // white wire (pin 5 and 6 have pwm frequency ~1000 Hz, faster than pin 9) | |
int statusLED = 13; | |
int delaymsec = 100; | |
void setup() { | |
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps |
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
#! /usr/bin/env bash | |
# llvm-gcc | |
if `type -P llvm-gcc &>/dev/null`; then | |
echo "Command Line Tools found." | |
else | |
echo "Command Line Tools not found." | |
echo "Please go https://developer.apple.com/downloads and install **Command Line Tools for Xcode**" && exit 0; | |
fi |
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
Primary use case: workaround non-working "ip link set wlan0 netns ..." for some network drivers. | |
Secondary use case: simple demo for getting/setting the MAC address, tun/tap, raw sockets... | |
Pre-built version: http://vi-server.org/pub/tap_copy |
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
<?php | |
require 'google-api/apiClient.php'; | |
require 'google-api/contrib/apiOauth2Service.php'; | |
require 'google-api/contrib/apiDriveService.php'; | |
$pdfFile = 'test.pdf'; | |
// API Console: https://code.google.com/apis/console/ | |
// Create an API project ("web applications") and put the client id and client secret in config.ini. |
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
sorted = window.items.sort((a,b) -> a.track_id - b.track_id) | |
results = [] | |
for item,i in sorted | |
if i < sorted.length - 1 && sorted[ i + 1 ].element_id == sorted[i].element_id | |
results.push sorted[i] | |
results |