Skip to content

Instantly share code, notes, and snippets.

@prusswan
prusswan / gist:5703074
Last active December 18, 2015 01:19
Ruby and Rails offline docs generation
# rails
sdoc -x test -x example -x bin -N --main rails-3.2.13/README.rdoc --title "Rails 3.2.13" --op ~/Desktop/rails-3.2.13 rails-3.2.13
# ruby (rbenv)
sdoc --main ruby-1.9.3-p392/README -x test -x example -x bin -N --title "Ruby 1.9.3" --op ~/Desktop/ruby-1.9.3 ~/.rbenv/sources/1.9.3-p392/ruby-1.9.3-p392 ~/.rbenv/sources/1.9.3-p392/ruby-1.9.3-p392/README
sdoc --main ruby-1.9.3-p392/README -x test -x example -x bin -N --title "Ruby 1.9.3" --op ~/Desktop/ruby-1.9.3 ruby-1.9.3-p392 ruby-1.9.3-p392/README
# not working yet
sdoc --main ruby-2.0.0-p195/README -x test -x example -x bin -N --title "Ruby 2.0.0" --op ~/Desktop/ruby-2.0.0 ~/.rbenv/sources/2.0.0-p195/ruby-2.0.0-p195 ~/.rbenv/sources/2.0.0-p195/ruby-2.0.0-p195/README
@prusswan
prusswan / gnome-xmonad.desktop
Created April 7, 2013 17:49
xmonad config for Ubuntu Precise
[Desktop Entry]
Name=GNOME with Xmonad
Comment=A GNOME fallback mode session using xmonad as the window manager.
Exec=gnome-session-xmonad
TryExec=gnome-session
Icon=
Type=Application
# /usr/share/xsessions/gnome-xmonad.desktop
Boot Info Script e7fc706 + Boot-Repair extra info [Boot-Info 31Jan2013]
============================= Boot Info Summary: ===============================
=> Windows 7/8/2012 is installed in the MBR of /dev/sda.
=> Syslinux MBR (3.00-3.35) is installed in the MBR of /dev/sdb.
sda1: __________________________________________________________________________
@prusswan
prusswan / graphite
Created March 15, 2013 05:29 — forked from drawks/graphite
#This is the "site config" for nginx
upstream django {
# Distribute requests to servers based on client IP. This keeps load
# balancing fair but consistent per-client. In this instance we're
# only using one uWGSI worker anyway.
ip_hash;
server unix:/tmp/uwsgi.sock;
}
server {
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
@prusswan
prusswan / math puzzle.rb
Last active December 14, 2015 00:19
X+Y
h = Hash.new(0)
product = Hash.new([])
sum = Hash.new([])
(2..99).to_a.each do |x|
next if x == 99
((x+1)..99).to_a.each do |y|
# puts "#{x} #{y} #{x+y} #{x*y}"
puts product[x*y]
product[x*y] = product[x*y].push([x,y])