Skip to content

Instantly share code, notes, and snippets.

View wezm's full-sized avatar

Wesley Moore wezm

View GitHub Profile
@wezm
wezm / genx-atom.js
Created January 26, 2011 08:44
Example of using genx to produce an Atom feed
var genx = require('genx')
, http = require('http')
, jsdom = require('jsdom').jsdom
, qs = require('querystring')
, uuid = require('node-uuid');
function ISODateString(d){
function pad(n){return n<10 ? '0'+n : n}
return d.getUTCFullYear()+'-'
+ pad(d.getUTCMonth()+1)+'-'
<html>
<head>
<title>GData Session Acquirer</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the latest version of the Google Data JavaScript Client
google.load('gdata', '2.x');
function onGoogleDataLoad() {
// Put your code here
@wezm
wezm / README.mkdn
Created October 19, 2010 01:53
Category that stubs out enough of UITextView to allow categories upon it to be speced
@wezm
wezm / backblaze_mtree.txt
Created June 23, 2010 23:09
Backblaze disk usage
# user: wmoore
# machine: Wes-Mac-Pro.local
# tree: /Library/Backblaze
# date: Thu Jun 24 09:08:17 2010
# .
/set type=file
. type=dir size=442
UninstallBackblaze.zip \
size=195754
@wezm
wezm / Screenshot.png
Created May 17, 2010 04:29
Radio stack URLs bookmarklet
Screenshot.png
#!/bin/sh
for i in `jot 964`; do
revision="-r1.$i"
message=`rlog $revision ../GENERIC | grep -A1 '^date:' | grep -v '^date:'`
co -p $revision ../GENERIC >GENERIC
if [ $i -eq 1 ]; then
git add GENERIC
#!/usr/bin/ruby
require 'csv'
if ARGV.length < 2
puts "Usage: process_export_for_lastpass.rb keychain_export.tsv lastpass_import.csv"
exit 2
end
# LastPass CSV format:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <blkid/blkid.h> /* Linux, requires libblkid-dev on Debian/Ubuntu */
/* Small program to print the device name that a file resides on.
Uses stat to get the device id then devname or blkid_devno_to_devname
to convert the dev id to a device name */
int main(int argc, char **argv)
@implementation MyClass : CPObject
{
}
- (CPString)helloWorld
{
return @"Hello World"
}
@end
require 'rubygems'
require 'rack/cache'
infinity = Proc.new do |env|
# env['HTTP_CACHE_CONTROL'] = 'max-age=60'
[200, {"Content-Type" => "text/plain", 'Cache-Control' => 'max-age=60'}, env.inspect]
end
use Rack::CommonLogger