Skip to content

Instantly share code, notes, and snippets.

@whichlight
whichlight / index.html
Last active December 18, 2015 17:18
Embedly drag and drop example
<!DOCCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=620">
<title>Embedly Drag and Drop</title>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.embedly-3.1.1.min.js"></script>
</head>
@whichlight
whichlight / gist:5522924
Created May 6, 2013 01:46
blue generator , web audio synth 1.
$(document).ready(function(){
$(".start").css("width","100%");
$(".start").css("height","100px");
$(".start").css("background-color","#A6D1FF");
$(".start").css("cursor","pointer");
var playing = false;
try{
@whichlight
whichlight / gist:5506776
Created May 3, 2013 02:13
simple deep drone synth
s1 = get_synth(35);
s2 = get_synth(35.2);
function get_synth(pitch){
nodes={};
nodes.source = myAudioContext.createOscillator();
nodes.source.type=3;
nodes.filter = myAudioContext.createBiquadFilter();
nodes.volume = myAudioContext.createGainNode();
nodes.filter.type=0; //0 is a low pass filter
@whichlight
whichlight / gist:4645157
Created January 26, 2013 22:45
libusb autogen error
libusb -> ./autogen.sh
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:34: error: 'AM_CONFIG_HEADER': this macro is obsolete.
==> ./autogen.sh
You should use the 'AC_CONFIG_HEADERS' macro instead.
/usr/local/Cellar/automake/1.13.1/share/aclocal-1.13/obsolete-err.m4:14: AM_CONFIG_HEADER is expanded from...
configure.ac:25: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
@whichlight
whichlight / minimal_tone.ino
Created September 23, 2012 15:53
minimal tone example
// http://arduino.cc/en/Reference/Tone
void setup() {
// iterate over the notes of the melody:
}
void loop() {
tone(8, 2000);
}
@whichlight
whichlight / twilio-snippet.py
Created August 7, 2012 03:51
twilio snippet, using get and post
from flask import Flask
import flask
from twilio.rest import TwilioRestClient
import re
import random
import twilio.twiml
import os
'''
A snippet of a twilio app, using GET and POST
@whichlight
whichlight / like-bomb.js
Created July 13, 2012 04:27
client side programmatic "liking" on facebook
/*
This code will click like's currently loaded
on a facebook page. It's likely in the future
the name of the classes may change.
Be careful though, if you do too many at once
you'll get a warning.
To use this copy and paste it to your browser's
javascript console, or add javascript: to the
@whichlight
whichlight / firebase-accelerometer
Created June 24, 2012 02:55
playing around with accelerometer stuff in firebase
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type='text/javascript' src='http://static.firebase.com/demo/firebase.js'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
@whichlight
whichlight / node-scraper-example.js
Created June 17, 2012 02:20
example code for a blog post on scraping with ndoe
//see whichlight.com/blog/writing-a-web-scraper-over-http-with-nodejs for details
app.get('/pullstagram/:link?', function(req,res){
url = req.params.link;
console.log(url);
request(url,function(err,response,body){
if (!err && response.statusCode == 200) {
var window = jsdom(body).createWindow(),
$ = require('jquery').create(window);
var val = $('.photo').attr('src');