Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Aki Atoji akiatoji

🏠
Working from home
  • TARDIS
Block or report user

Report or block akiatoji

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@akiatoji
akiatoji / hack.sh
Created Mar 31, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
View Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
#Steps to install RVM + Ruby 1.9.2 + Rails + nginx + Passenger on CentOS (tested on v5.5)
# Install git and curl, if not already installed
sudo yum install git
sudo yum install curl
# Create the rvm group and add any users who will be using rvm to the group
sudo su -
groupadd rvm
@akiatoji
akiatoji / Gemfile
Created Apr 7, 2012 — forked from simi/Gemfile
Refinery + Twitter Bootstrap WIP
View Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@akiatoji
akiatoji / ruby19.sh
Created Apr 9, 2012
AWS AMI Bootstrap for Ruby1.9.3 + Chef (WIP)
View ruby19.sh
#!/bin/sh
sudo yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs
sudo yum install openssl-devel zlib-devel \
gcc gcc-c++ make autoconf readline-devel \
curl-devel expat-devel gettext-devel
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
@akiatoji
akiatoji / precompile_assets.textile
Created Apr 11, 2012 — forked from kathgironpe/precompile_assets.textile
Rails 3.1: Precompile Assets for Cloudfront/CDN support
View precompile_assets.textile

Naming files and using asset_path

application.scss.erb
- use <%= asset_path 'background.jpg' %>

on config/environments/production.rb

@akiatoji
akiatoji / vagrant.org
Created Jun 6, 2012
CentOS 6.2 Box for Vagrant
View vagrant.org

Installing CentOS

Download net install iso: CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
  • Version: Red Hat
@akiatoji
akiatoji / gist:2949808
Created Jun 18, 2012
Set up YARD to view locally installed gem rdocs
View gist:2949808
gem install yard
gem install redcarpet #needed to show markdown files
gem install github-markup
yard gems --rebuild
yard server -r -g -d
@akiatoji
akiatoji / gist:2990910
Created Jun 25, 2012
awesome_print uninitialized constant BSON error fix
View gist:2990910

Started getting error below with edge mongoid.

aki@rydeen~/Dropbox/RubyProjects/zitta-orders > rails c
Loading development environment (Rails 3.2.6)
ruby-1.9.2-p290 :001 > ap 'wheee'
NameError: uninitialized constant BSON
	from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/ext/mongoid.rb:23:in `cast_with_mongoid'
	from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/formatter.rb:24:in `format'
@akiatoji
akiatoji / gist:2992948
Created Jun 26, 2012
rspec let syntax trickery
View gist:2992948

Seems variables defined by let(){} is lazily instantiated.

This caused problems like so in specs:

let(:estimate){Fabricate.build(:shipping_estimate)}
...
ShippingEstimate.should_receive(:new).and_return(estimate) 
...
# ends up calling methods on uninstantiated (nil) estimate
@akiatoji
akiatoji / gist:3011794
Created Jun 28, 2012
OS X Lion: "yaml.h not found" error when trying to install Python modules (homebrew)
View gist:3011794

On OS X 10.7.4, you need to install libyaml by hand. Using homewbrew:

brew install libyaml

Then you can happily install python modules

sudo easy_install nltk SOAPpy pyOpenSSL lxml 
You can’t perform that action at this time.