Skip to content

Instantly share code, notes, and snippets.

$ make bench
godep go test -bench=.
PASS
BenchmarkGifsicle_Resize_GIF 100 21002215 ns/op
BenchmarkGifsicle_Resize_animatedGIF 10 131517443 ns/op
BenchmarkNFNT_Resize_JPG 30 43795775 ns/op
BenchmarkNFNT_Resize_JPG2PNG 30 47766347 ns/op
BenchmarkNFNT_Resize_JPG2GIF 30 54370537 ns/op
BenchmarkNFNT_Resize_PNG 30 52384573 ns/op
BenchmarkNFNT_Resize_PNG2JPG 20 50822543 ns/op
Header set X-Robots-Tag "noindex, nofollow"
@subosito
subosito / shell
Created February 13, 2012 06:26
Convert ruby 1.8 to 1.9 hash syntax
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' **/*.rb
@subosito
subosito / subosito.zsh-theme
Created August 26, 2012 13:39
personal zsh theme
#
# _ _
# | | (_) _
# ___ _ _| |__ ___ ___ _ _| |_ ___
# /___) | | | _ \ / _ \ /___) (_ _) _ \
# |___ | |_| | |_) ) |_| |___ | | | || |_| |
# (___/|____/|____/ \___/(___/|_| \__)___/
#
#
@subosito
subosito / issue
Created August 31, 2012 02:12
/etc/
()~()
(-___-)
==`-'==
< Arch Linux >
@subosito
subosito / digitalocean.txt
Created September 18, 2012 13:12
VPS Benchmarks
:~# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 13.7857 s, 77.9 MB/s
:~# wget -O /dev/null http://cachefly.cachefly.net/100mb.test
--2012-09-18 13:09:12-- http://cachefly.cachefly.net/100mb.test
Resolving cachefly.cachefly.net (cachefly.cachefly.net)... 205.234.175.175
Connecting to cachefly.cachefly.net (cachefly.cachefly.net)|205.234.175.175|:80... connected.
HTTP request sent, awaiting response... 200 OK
@subosito
subosito / devise.diff
Created February 7, 2013 02:53
devise ajax
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index e69156d..6b328d3 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -56,6 +56,7 @@ Devise.setup do |config|
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
+ config.http_authenticatable_on_xhr = false
require 'redcarpet'
desired_result = "<p>This is should be <strong>strong</strong> and <em>italics</em>!</p>\n"
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
result = markdown.render("This is should be **strong** and *italics*!")
puts "Desired Result : #{desired_result}"
puts "Actual Result : #{result}"
@subosito
subosito / setup.py
Created September 2, 2013 11:44
sixpack-go build!
#!/usr/bin/env python
from sixpack import __version__
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
require 'goliath'
## OUTPUT
#
# use Middleware
# use Goliath::Rack::BarrierAroundwareFactory, Aroundware
# use Goliath::Rack::BarrierAroundwareFactory, Anotherware
#
# APP: on_headers
# APP: on_body