Skip to content

Instantly share code, notes, and snippets.

View mnutt's full-sized avatar

Michael Nutt mnutt

View GitHub Profile
Torrentizer Flow
=======
creator POSTS to /create/#{feed_url}
sinatra adds url to Url db if url doesn't exist
sinatra 301 redirects creator to /made/#{hash}
hasher_loop do
feed_urls.all.each do |url|
== NGINX HTTP PUSH ==
Steps to reproduce:
Install passenger gem:
sudo gem install passenger
Download nginx:
wget http://sysoev.ru/nginx/nginx-0.7.62.tar.gz
tar -zxvf nginx-0.7.62.tar.gz
<html>
<head>
<title>RSpec</title>
<style>
body {
background-color: #333;
color: #FFF;
font-family: "Lucida Grande", "Helvetica", sans-serif;
}
require 'erb'
require 'spec/runner/formatter/base_text_formatter'
require 'spec/runner/formatter/no_op_method_missing'
class CukeappFormatter < Spec::Runner::Formatter::BaseTextFormatter
include ERB::Util # for the #h method
include Spec::Runner::Formatter::NOOPMethodMissing
include Spec::Runner::Formatter
def initialize(options, output)
<html>
<head>
<title>Mutation</title>
<script type="text/javascript">
var canvas;
var ctx;
// Colors to use for the circles. A larger array means more circles.
var colors = ["rgba(171, 207, 43, 0.5)",
"rgba(201, 7, 33, 0.5)",
#!/usr/bin/env macruby
# from tomafro.net
framework 'Cocoa'
framework 'WebKit'
class Snapper
attr_accessor :options, :view, :window
def initialize(options = {})
process.mixin(GLOBAL, require("sys"));
var posix = require("posix");
posix.stat("/etc/hsdfsd").addCallback(function(stat) {
puts(stat);
}).addErrback(function(err) {
puts(err);
}).wait();
// Error: No such file or directory
var fs = require("fs");
fs.readFile("/etc/hosts").addCallback(function (content) {
sys.puts(content);
});
// TypeError: Cannot call method 'addCallback' of undefined
// at Object.<anonymous> (/Users/mnutt/code/feature_service/test.js:2:27)
// at Module._loadContent (node.js:929:21)
// at node.js:957:20
// at node.js:561:25
// node.js v0.1.91
Error: Parse Error
at Stream.ondata (http:524:30)
at IOWatcher.callback (net:307:31)
at node.js:748:9
#!/usr/bin/env ruby
# ffcurl
#
# This curl that automatically uses your firefox cookies. Use it like you would normally
# use curl. Report bugs to michael@nuttnet.net. Or better yet, fork it from:
#
# http://gist.github.com/393140
#
# Also for webkit/safari: http://gist.github.com/393141