Skip to content

Instantly share code, notes, and snippets.

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 / _usage
Created August 13, 2012 16:54
rbenv + openshift
curl https://raw.github.com/gist/3342482/57d1f618104185aa89044f934c4f86cb74e11553/rbenv-openshift.sh | bash
@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 / _
Created December 7, 2012 00:39
xinit service on systemd
systemctl enable xinit.service
@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(