Skip to content

Instantly share code, notes, and snippets.

View devongovett's full-sized avatar

Devon Govett devongovett

View GitHub Profile
@devongovett
devongovett / spinner.jade
Created July 15, 2013 01:12
Simple image-free loading spinner using Jade and Stylus
.spinner
- for (var i = 1; i <= 12; i++)
span
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
char * number2filename(char *start, int digits, int num, char *end) {
int size = strlen(start) + strlen(end) + 1;
int formatSize = size + 3 + log10(digits) + 1;
char *format = (char *)malloc(formatSize);

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:

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);
/*
* 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.
<!doctype html>
<script>
function pause() {
console.log('pause')
node.disconnect()
}
function play() {
console.log('play');
#!/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
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();
}
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)
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();