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 logging | |
RED='\033[0;31m' | |
CYAN='\033[0;36m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
logger = logging.getLogger('myapp') | |
logfile = logging.FileHandler('warnings.log') |
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
self.fadeIn += fadeStep; | |
if(fadeIn < fadeMax) { | |
alarm[0] = fadeSpeed; | |
} |
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/python | |
import MySQLdb | |
import csv | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
query = "\ | |
select id, name, gross_amt \ | |
from cafeteria \ |
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
DPAD Up -> c | |
DPAD Down -> d | |
DPAD Left -> e | |
DPAD Right -> f | |
L Analog Left -> Left Arrow | |
L Analog Right -> Right Arrow | |
L Analog Up -> Up Arrow | |
L Analog Down -> Down Arrow |
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
#!/bin/bash | |
DEST_DIR="/home/iPod" | |
FULL_PATH="$1" | |
ALBUM=$(basename "$FULL_PATH") | |
NEW_PATH="$DEST_DIR/$ALBUM" | |
echo "Transcoding into $NEW_PATH" | |
mkdir "$NEW_PATH" |
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
#!/bin/sh | |
curl -H 'X-AIO-Key: feedfacedaedbeef' -H 'Content-Type: application/json' -X POST https://io.adafruit.com/api/feeds/myfeedname/data.json -d'{"value": 17}' |
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 sleekxmpp | |
class Jabber(sleekxmpp.ClientXMPP): | |
def __init__(self, username, password, instance_name=None): | |
jid = "%s/%s" % (username, instance_name) if instance_name else username | |
super(Jabber, self).__init__(jid, password) | |
self.instance_name = instance_name | |
self.add_event_handler('session_start', self.start, threaded=False, disposable=True) | |
self.add_event_handler('message', self.receive, threaded=True, disposable=False) |
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
check host gateway with address 192.168.1.1 | |
start "/usr/sbin/service networking start" | |
stop "/usr/sbin/service networking stop" | |
if failed icmp type echo count 5 with timeout 10 seconds | |
then restart | |
if 4 restarts within 5 cycles | |
then exec /sbin/reboot |
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
#!/bin/bash | |
FILE_PATH="$1" | |
FILE_DIR=$(dirname "$FILE_PATH") | |
FILE_NAME=$(basename "$FILE_PATH") | |
FILE_BASE="${FILE_NAME%.*}" | |
avconv -i "$FILE_PATH" -vcodec h264 -acodec aac -strict -2 "$FILE_DIR/$FILE_BASE.mp4" | |
rm -r -f "$FILE_PATH" |
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 java.nio.*; | |
import org.usb4java.*; | |
public class ReadTrinket { | |
public static void main(String args[]) { | |
Context context = init(); | |
DeviceHandle trinketHandle = openDevice(); | |
try { | |
int result = LibUsb.claimInterface(trinketHandle, (short) 0x00); |