Skip to content

Instantly share code, notes, and snippets.

@drewwells
drewwells / SassMeister-input.scss
Created August 19, 2015 13:42
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
.foo{
@extend .bar;
}
@drewwells
drewwells / Simple jsonp proxy via node-http-proxy
Created March 10, 2011 17:53
This demo works for basic data, generic requests ie url=http://google.com don't work
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 March 18, 2011 21:10
Add FPS meter to any page
//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 / LICENSE.txt
Created August 12, 2011 01:46 — forked from padolsey/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
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 August 30, 2011 05:08
PhiloGL O3D.Plane
<!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 September 15, 2011 15:31
Merge data from many AJAX requests
function aj( url ){
return $.ajax({
url: url,
success: function( data ){
}
);
}
function resolve( args ){
@drewwells
drewwells / index.js
Created October 17, 2011 17:44 — 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]
/*
* 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'),

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

@drewwells
drewwells / index.js
Created November 12, 2011 16:53
PhiloGL Lesson 6 using canvas as image source
function webGLStart() {
var c = document.createElement( 'canvas' ),
ctx = c.getContext( '2d' ),
img = new Image();
c.width = 256; c.height = 256;
ctx.save();
ctx.strokeStyle = 'Red';
ctx.font = 'normal 24px helvetica, arial';