Skip to content

Instantly share code, notes, and snippets.

View cristibalan's full-sized avatar

Cristi Balan cristibalan

View GitHub Profile
# gem 'activerecord', '=4.0.2'
gem 'activerecord', '=4.1.0.rc1'
require 'active_record'
require 'minitest/autorun'
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.establish_connection(adapter: "postgresql", host: "localhost", user: "cristi", database: "test")
class Message < ActiveRecord::Base
connection.create_table table_name, force: true do |t|
@cristibalan
cristibalan / end of .zshrc
Created July 4, 2011 09:03
Y U LOSE PATH?
# Customize to your needs...
export PATH=~/bin/chelu:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
- pixel editor
- existing work
- http://piq.codeus.net/ - nice features but in flash
- http://code.google.com/p/grafx2/ - very advanced, windows
- http://pixie.strd6.com/pixel-editor - js, simple
- [http://www.rw-designer.com/online_icon_maker.php]()
- http://canvaspaint.org/ - js mspaint clone
- http://www.amberfrog.com/product/bme/
- new existing work
- http://muro.deviantart.com/
# include bundled assets if not in development
# this allows us to deploy without installing jammit
module JammitHelper
def include_stylesheets(*packages)
return super if Rails.env.development? || Rails.env == 'test'
options = packages.extract_options!
files = asset_tags(:css, packages)
files.push(options) unless options.empty?
module HamlJs
class Filter
def initialize(app)
@app = app
end
def call(env)
dup._call(env)
end
" VAMP 0.1
" Script to send answers to vamp questions.
"
" Read more at:
" http://vamp.ducki.es
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CONFIG YOUR VAMP DETAILS BELOW
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#!/bin/bash
# from http://code.google.com/p/macvim/wiki/Building
cd src
make clean
./configure --enable-gui=macvim --with-features=huge --enable-cscope --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-sniff --enable-multibyte --with-macarchs=x86_64 --with-macsdk=10.6
make
cd MacVim
xcodebuild
rm -rf MacVim.app
require 'rubygems'
require 'mail'
Mail.defaults do
smtp "smtp.gmail.com" do
port 587
enable_tls
user "yomomma@gmail.com"
pass "yomommasobig"
helo "localhost.localdomain"
require 'iconv'
require 'rubygems'
require 'mail'
s = Mail::SubjectField.new("From", 'Subject: =?ISO-8859-1?Q?Re=3A_ol=E1?=')
s.decoded # => "Re: ol\341" (LATIN1 bytes)
Iconv.conv("UTF8", "LATIN1", s.decoded) # => "Re: ol\303\241" (UTF8 bytes)
Mail::Encodings.unquote_and_convert_to(s.value, 'UTF8') # => "Re: ol\303\241" (UTF8 bytes)
require 'net/http'
module Rack
class GistInline
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)