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
(duh?) | |
... jk ... anything I can nom nom nom. | |
:) | |
And coffee. | |
FEED ME CODE |
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
from Tkinter import * | |
import json | |
import urllib2 | |
def get_location(): | |
req = urllib2.urlopen('http://freegeoip.net/json/') | |
req_str = req.read() | |
return json.loads(req_str) | |
def get_todays_weather(coords): |
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
import alsaaudio | |
import serial | |
#import numpy | |
import struct | |
import math | |
ser = serial.Serial('/dev/ttyUSB0', 19200) | |
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NORMAL, 'Device') | |
inp.setchannels(1) |
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
function doSearch(text){ | |
var registrations = window.registrations; | |
for (var i = 0; i < registrations.length; i++){ | |
var str = registrations[i].first_name + ' ' + registrations[i].last_name + ' ' + registrations[i].email; | |
if (str.toLowerCase().indexOf(text.toLowerCase()) != -1){ | |
$('<li/>').html(registrations[i].id + ': ').append($('<a/>', {href: '/admin_stats/add_registration/' + registrations[i].id, text: str})).appendTo('#results'); | |
} | |
} | |
} |
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
<script src="//js.leapmotion.com/0.2.2/leap.min.js"></script> | |
<script> | |
window.addEventListener('load', function(){ | |
var ctl = new Leap.Controller({enableGestures: true}); | |
var swiper = ctl.gesture('swipe'); | |
var totalDistance = 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
http://catalogue.usc.edu/schools/architecture/courses/ | |
http://catalogue.usc.edu/schools/business/courses/ | |
http://catalogue.usc.edu/schools/accounting/courses/ | |
http://catalogue.usc.edu/schools/business/courses/ | |
http://catalogue.usc.edu/schools/accounting/courses/ | |
http://catalogue.usc.edu/schools/business/courses/ | |
http://catalogue.usc.edu/schools/accounting/courses/ | |
http://catalogue.usc.edu/schools/cinema/courses/ | |
http://catalogue.usc.edu/schools/college/amst/courses/ | |
http://catalogue.usc.edu/schools/college/anth/courses/ |
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
#include <iostream> | |
#include <iomanip> | |
#include <cmath> | |
#include <cmath> | |
using namespace std; | |
int main() | |
{ | |
int A, B, C, dec; |
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
sparks% cat benchmark.js | |
var obj = {}, num_in = 1000000; | |
while(num_in--){ | |
obj[(Math.random()*10000).toString()] = Math.random().toString(); | |
} | |
function time_it(fn_tm){ | |
var start_time = new Date().getTime(); | |
fn_tm(); | |
var end_time = new Date().getTime(); |
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 express = require('express'), | |
socketio = require('socket.io'), | |
app = express.createServer(), | |
serialport = require('serialport'), | |
serial_term = new serialport.SerialPort('/dev/tty.usbmodem1d11'), | |
sio = socketio.listen(app); | |
var databuf = ''; | |
sio.sockets.on('connection', function(socket){ |
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 styluscomp = require('stylus'), | |
jadecomp = require('jade'), | |
fs = require('fs'); | |
function jade(data, cb, filename){ | |
cb(false, jadecomp.compile(data, { pretty: true, filename: filename })()); | |
} | |
function styl(data, cb, filename){ | |
styluscomp.render(data, { pretty: true, filename: filename }, cb); | |
} |
NewerOlder