Skip to content

Instantly share code, notes, and snippets.

View devongovett's full-sized avatar

Devon Govett devongovett

View GitHub Profile
@devongovett
devongovett / gist:2281027
Created April 2, 2012 05:33
flipped website effect for April Fools day on badassjs.com
// Original version
(function(){function s(v){document.documentElement.style[['','webkit','Moz','O','ms'].filter(function(p){return p+'Transform' in document.documentElement.style})[0]+'Transform']=v}if (!localStorage||!localStorage.flipped&&location.href!="http://badassjs.com/post/20294238453/webkit-js-yes-it-has-finally-happened-browser"){s('rotate(180deg)');document.links[0].onclick=function(){s('none');document.body.scrollTop=0;this.onclick=null;localStorage&&(localStorage.flipped=1);return !1}}})()
// Somewhat prettier version
(function() {
function s(v) {
document.documentElement.style[
['','webkit','Moz','O','ms'].filter(function(p){
return p + 'Transform' in document.documentElement.style
})[0]+'Transform'
@devongovett
devongovett / dabblet.css
Created May 4, 2012 20:42 — forked from LeaVerou/dabblet.css
Text masking — The SVG way
/**
* Text masking — The SVG way
*/
svg {
font: 900 500%/1.2 'Arial Black', sans-serif;
}
text {
fill: url(#wood);
player.onPostProcessing = function(buffer, channelCount) {
if (!player.playing) return;
var volume = DGPlayer.volume / 100;
for (var i = 0; i < buffer.length; i++) {
buffer[i] *= volume;
}
};
var filter = new VolumeFilter();
class DGArray
constructor: (Type, @lengths...) ->
if @lengths.length is 0
throw new RangeError("Not enough lengths.")
length = 1
for l in @lengths
length *= l
@data = new Type(length)
function makeBlob(data) {
try {
return new Blob([data]);
} catch (e) {}
if (typeof BlobBuilder !== "undefined" && BlobBuilder !== null) {
var bb = new BlobBuilder;
bb.append(data);
return bb.getBlob();
}
#!/usr/bin/env python
# first, download the code from http://www.vnsecurity.net/2010/03/codegate_challenge15_sha1_padding_attack/
import json
import sys
import urllib
import requests
import hashlib
from shaext import shaext
<!doctype html>
<script>
function pause() {
console.log('pause')
node.disconnect()
}
function play() {
console.log('play');
/*
* RSS Subscription Count Node.js Proxy Server
* Devon Govett
* Public Domain
*
* This script is a simple proxy server for my blog's RSS feed that keeps track of requests
* to the feed and attempts to guess a subscriber count.
* Google Reader represents the majority of my subscriber base, and they give you actual
* subscriber numbers when their spider requests your feed. Other aggregators do something similar.
* Otherwise, this script tracks unique IP addresses over a 24 hour period.
AV.loadModule = function() {
var Module = require('module');
var contextLoad = Module._contextLoad;
Module._contextLoad = true;
var AV = global.AV;
global.AV = require('av');
var ret = require.apply(null, arguments);

Renaming import

I'm looking for name suggestions for my import module. The purpose of the tool is to add file importing abilities to JavaScript and CoffeeScript files via a #import directive similar to other languages.

import is a bad name for the module for a number of reasons:

  1. import is a reserved word in JavaScript/CoffeeScript so you cannot write var import = require('import') without getting syntax errors.
  2. The import command line tool conflicts with another tool of the same name which is commonly installed on Linux and Mac systems as part of the Imagemagick package.

For these reasons, I'm looking for a new name. The criteria are basically that the name must be available on npm and it must not be a JS reserved word. Here are a few that I thought of: