Skip to content

Instantly share code, notes, and snippets.

View shuhblam's full-sized avatar

Cole Gillespie shuhblam

  • Tanium
  • Raleigh, North Carolina
View GitHub Profile
@shuhblam
shuhblam / get.php
Created July 6, 2011 14:47
proxy for dseif
<?php
$type = $_GET['type'];
if($type == 'scrape'){
$url = $_GET['url'];
$ch = curl_init("http://bandcamp.com".$url);
}
$html = curl_exec($ch);
curl_close($ch);
?>
//this is an example twitter call for geolocated tweets
//all you need is a lat lng to get tweets from anywhere
//in the world
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
//only get the first 5 pages
//since we are only interested
//in recent tweets
for (z = 0; z <= 5; z++) {
@shuhblam
shuhblam / gist:1129783
Created August 6, 2011 21:50
node setInterval
var fs = require('fs');
var http = require('http');
var server = http.createServer(function(req, response){
setInterval ( fetchMedia, 2000 );
fs.readFile(__dirname+'/index.html', function(err, data){
response.writeHead(200, {'Content-Type':'text/html'});
response.write(data);
response.end();
});
});
<!DOCTYPE html>
<html>
<head>
<title>Popcorn.js Tour Plug-in Demo</title>
<style type="text/css">
body{
margin: 0; padding: 0;
font-family: Georgia;
}
var twitter = require('ntwitter');
var t = new twitter({
});
t.stream('statuses/filter', { location: '-122.75,36.8,-121.75,37.8,-74,40,-73,41'}, function( stream ) {
console.log( stream )
stream.on('data', function (data) {
console.log(data);
@shuhblam
shuhblam / gist:1258019
Created October 2, 2011 21:51
how to stream a filter from ntwitter
t.stream('statuses/filter', {'locations':'-122.75,36.8,-121.75,37.8,-74,40,-73,41'} , function( stream ) {
stream.on('data', function ( data ) {
console.log( data );
});
});
@shuhblam
shuhblam / gist:1269336
Created October 7, 2011 02:59
popcorn test
var p = Popcorn("#silence")
.code({
start: 0,
end: 5,
onStart: function (options) {
},
onFrame: (function () {
var count = 0;
@shuhblam
shuhblam / gist:1453116
Created December 9, 2011 20:17
getting started with node for windows
1. download and install https://www.virtualbox.org/
2. follow this tutorial on getting ubuntu set up http://www.psychocats.net/ubuntu/virtualbox
3. get node onto ubuntu via this tutorial http://www.giantflyingsaucer.com/blog/?p=1688
var xhrArgs = {
url: "/ofm/console/",
handle: function (e, io) {
var html = io.xhr.responseText;
//somehow get the contents of the title of html
}
}
// Call the asynchronous xhrGet
var deferred = dojo.xhrGet(xhrArgs);
@shuhblam
shuhblam / gist:1637537
Created January 19, 2012 03:23
popcorn no butter
document.addEventListener("DOMContentLoaded", function () {
VideoJS.setupAllWhenReady();
var p = Popcorn('#video');
p.code({
start: 0,
end: 10,
onStart: function (options) {
console.log('started')
},