Skip to content

Instantly share code, notes, and snippets.

View inem's full-sized avatar

Ivan Nemytchenko inem

View GitHub Profile
# Reincarnation for classes
class Class
def reincarnate
buried = Object.__send__(:remove_const, self.name)
Object.const_set(self.name, Class.new(buried))
end
end
class Abc
1) Install pre-requisites
$ sudo port install libiconv slang2 glib2
2) Download the sources from http://www.midnight-commander.org/downloads
3) Configure the build:
./configure --prefix=/opt/mc --with-screen=slang --enable-extcharset --enable-charset --with-libiconv-prefix=/opt/local --with-slang-includes=/opt/local/include --with-slang-libs=/opt/local/lib
@inem
inem / url_dsl.rb
Created December 15, 2009 21:36 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
#!/bin/bash -xe
EBS_DEVICE='/dev/sdh'
INSTANCE_ID=$1
AKI=${2:-'aki-5f15f636'}
ARI=${3:-'ari-0915f660'}
ARCH=${4:-'i386'}
SIZE=${5:-10}
AZ=${6:-'us-east-1d'}
NAME=${7:-"ami-from-$INSTANCE_ID"}

A Note

Forking has been fixed, but the old repositories will still be corrupted.

Basics

The method page will create a new page: page "home" do "Hello, world!"

# Oleg Andreev <[email protected]> Oct 16, 2009
#
# This demonstrates how to perform a request to the same Rails instance without hitting HTTP server.
# Note 1: this does not boot another Rails instance
# Note 2: this does not involve HTTP parsing
# Note 3: dispatch_unlocked and rack.multithread=true are used to prevent deadlock on a dispatch mutex,
# NOT to make inner requests operate concurrently as one may think.
# Note 4: inner request is created by merging outer request with some HTTP headers and rack options.
# This may probably lead to strange effects, so be aware of it.
# Perhaps, we shouldn't use outer request at all. I don't know.
reinstall mysql - 64bit 10.5 build
- then reload the db
remove old macports dir - http://trac.macports.org/wiki/FAQ#uninstall
- and replace with new one built from source - http://forums.macrumors.com/showthread.php?t=720035
install ruby 1.8.6 - used rvm http://rvm.beginrescueend.com/
killed my old ~/.gem folder as they weren't working
- install the mysql gem - this was a pain
installed required gems by rake gems:install (do it for RAILS_ENV=test as well)
gem install webrat (for some reason rake gems didn't get it)
installed snow leopard compatibility bundle for textmate - http://ticket.macromates.com/show?ticket_id=0FDE7076
RELEASE_OUTPUT_PATH = File.expand_path("~/Projects/releases/Squeemote")
TARGET_NAME = "Squeemote"
CONFIGURATION = ENV['CONFIGURATION'] || "Distribution"
SDK_VERSION = ENV['SDK'] || 'iphoneos2.2'
task :release do
puts "* Bumping build version."
`agvtool bump -all`
puts "* Building #{CONFIGURATION} release."
@inem
inem / 0what.md
Created August 24, 2009 02:59 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

# Controller
def dull_party
Human.class_eval do
def login
name
end
def hello_world
'Hello world!'