Skip to content

Instantly share code, notes, and snippets.

Drew Wells drewwells

Block or report user

Report or block drewwells

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drewwells
drewwells / Simple jsonp proxy via node-http-proxy
Created Mar 10, 2011
This demo works for basic data, generic requests ie url=http://google.com don't work
View Simple jsonp proxy via node-http-proxy
var http = require('http'),
httpProxy = require('http-proxy'),
url = require('url');
// Create your proxy server
httpProxy.createServer(function(req, res, proxy){
var baseUrl = url.parse(req.url, true),
query = baseUrl.query,
server = !!query.url ? query.url.replace(/http:\/\/([^:\/]+).*/i,function(url,server){return server;}) : '',
port = !!query.url ? query.url.match(/:(\d+)/) : 80;
@drewwells
drewwells / FPS meter me
Created Mar 18, 2011
Add FPS meter to any page
View FPS meter me
//Copy to URL bar:
javascript:var s=document.createElement("script");s.src="https://github.com/mrdoob/stats.js/raw/master/build/Stats.js",document.body.appendChild(s),s.onload=function(){var a=new Stats,b=a.domElement.style;b.position="fixed",b.left="0px",b.top="0px",document.body.appendChild(a.domElement),setInterval(a.update,1e3/60)}
//Source
var s = document.createElement('script');
s.src = 'https://github.com/mrdoob/stats.js/raw/master/build/Stats.js';
document.body.appendChild(s);
s.onload = function() {
var stats = new Stats(),
@drewwells
drewwells / core.test.js
Created Apr 14, 2011
RequireJS and QUnit sitting in a tree
View core.test.js
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});
@drewwells
drewwells / LICENSE.txt
Created Aug 12, 2011 — forked from padolsey/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@drewwells
drewwells / plot.html
Created Aug 30, 2011
PhiloGL O3D.Plane
View plot.html
<!DOCTYPE html>
<html>
<head>
<style>
body{
font-family: 'HelveticaRegular',arial,sans-serif;
}
</style>
<script id="shader-fs" type="x-shader/x-fragment">
@drewwells
drewwells / nResolve.js
Created Sep 15, 2011
Merge data from many AJAX requests
View nResolve.js
function aj( url ){
return $.ajax({
url: url,
success: function( data ){
}
);
}
function resolve( args ){
@drewwells
drewwells / index.js
Created Oct 17, 2011 — forked from steeleforge/index.js
Simple node.js webserver with logging. Serves whatever files are reachable from the directory where node is running. [support for Node for Windows]
View index.js
/*
* Fork & Refactor of https://gist.github.com/246761
* -> Credit: Noah Sloan <http://noahsloan.com>
*/
/**
* Simple webserver with logging. Serves whatever files are reachable from
* the directory where node is running. Supports Windows port of node.
*/
var fs = require('fs'),
@drewwells
drewwells / Custom.css
Created Oct 26, 2011 — forked from anonymous/gist:1258555
Solarized Dark Theme (with sidebar and view-source colors) for Google Chrome Dev Tools
View Custom.css
/**********************************************/
/*
/* Solarized Dark Skin by Mark Osborne - 2011
/*
/* Based on IR_Black Skin by Ben Truyman:
/* https://gist.github.com/1245727
/*
/* and Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
View README.md

Issue with manipulating base href and jQuery UI making ajax calls to the new document.baseURI.

You can’t perform that action at this time.