Skip to content

Instantly share code, notes, and snippets.

diff -Naur nginx_uploadprogress_module/ngx_http_uploadprogress_module.c nginx_uploadprogress_module_safari_fix/ngx_http_uploadprogress_module.c
--- nginx_uploadprogress_module/ngx_http_uploadprogress_module.c 2007-10-10 11:42:17.000000000 +0000
+++ nginx_uploadprogress_module_safari_fix/ngx_http_uploadprogress_module.c 2008-02-29 14:24:49.000000000 +0000
@@ -7,6 +7,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ctype.h>
#define TIMER_FREQUENCY 15 * 1000
Lorem ipsum sdfdsfsdfsdfsdf
@ubermuda
ubermuda / gist:3054
Created July 29, 2008 09:40
a styleshit to clean the facebook interface
@-moz-document domain(facebook.com)
{
.myofferpal,
.UICompatibilityFrame_SidebarAds,
.UICompatibilityFrame_FooterAdsContainer,
.UIStandardFrame_SidebarAds,
.profile_sidebar_ads,
.sponsor,
.invitefriends,
.findfriends,
@mudge
mudge / count.rb
Created July 29, 2008 10:37
A fast count method for Ruby 1.8 arrays.
class Array
def count(elem)
length - (self - [elem]).length
end
end
@kirel
kirel / gist:3060
Created July 29, 2008 10:44
Scraping ugly tables...
#!/usr/bin/ruby
require 'rubygems'
gem 'RubyInline', '=3.6.3'
require 'scrubyt'
bus_data = Scrubyt::Extractor.define do
fetch 'http://rvm-online.de'
route = { :place_origin => "everswinkel",
:name_origin => "mitte",
@mudge
mudge / averageable.rb
Created July 29, 2008 10:49
Methods to calculate the mean, median and mode of an array.
module Averageable
def mean(&block)
sum(&block) / length.to_f
end
def count(elem)
length - (self - [elem]).length
end
def mode
@mudge
mudge / count_benchmark.rb
Created July 29, 2008 11:10
Comparing two different implementations of a count method for arrays.
require 'benchmark'
class Array
def count_with_loop(elem)
enum = 0
each { |e| enum += 1 if elem == e }
enum
end
def count_without_loop(elem)
#!/usr/bin/ruby
class A
def dsl &block
puts "dsl active"
instance_eval &block
end
private
def priv
puts "This is private - please stay out"
end
// ==UserScript==
// @name LDR + Tombloo
// @namespace http://userscripts.org/users/7010
// @updateURL http://userscripts.org/scripts/source/23537.user.js
// @include http://reader.livedoor.com/reader/*
// @include http://fastladder.com/reader/*
// ==/UserScript==
GM_addStyle(<><![CDATA[