Skip to content

Instantly share code, notes, and snippets.

View yangtheman's full-sized avatar
🏠
Working from home

yangtheman

🏠
Working from home
View GitHub Profile
@yangtheman
yangtheman / kidsruby_installer.sh
Created January 17, 2012 06:26 — forked from patrickgombert/kidsruby_installer.sh
Kids Ruby Ubuntu Installer
#!/bin/bash
echo "Installing Kids Ruby!"
sudo apt-get install git
# rbenv
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo `export PATH="$HOME/.rbenv/bin:$PATH"` >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
@yangtheman
yangtheman / gist:1625856
Created January 17, 2012 09:30
Kidsruby on Ubuntu
# http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
sudo apt-get install build-essential git-core curl
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
source .bashrc
@yangtheman
yangtheman / gist:3161137
Created July 22, 2012 21:56
Brew install ntfs-3g lion
newshinymac:~ yangtheman$ /Developer/usr/bin/xcodebuild -version
Xcode 4.2
Build version 4D199
newshinymac:~ yangtheman$ brew install ntfs-3g
==> Installing ntfs-3g dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.27 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig
==> make
==> make check
@yangtheman
yangtheman / gist:3385289
Created August 18, 2012 08:24
/etc/nginx/nginx.conf
user www-data;
worker_processes 10;
pid /var/run/nginx.pid;
events
{
worker_connections 1024;
@yangtheman
yangtheman / gist:3385305
Created August 18, 2012 08:26
/etc/nginx/rubber/unicorn_nginx.conf
upstream unicorn_server {
# This is the socket we configured in unicorn.rb
server unix:/var/run/unicorn.sock
fail_timeout=0;
}
server {
listen 80;
client_max_body_size 4G;
server_name picpler.com;
@yangtheman
yangtheman / gist:3861053
Created October 9, 2012 19:57
500 error with not much error message
2012-10-09T19:54:46+00:00 app[web.1]: Rendered shared/_header.html.haml (75.4ms)
2012-10-09T19:54:46+00:00 app[web.1]: Rendered shared/_trackers.html.haml (14.5ms)
2012-10-09T19:54:46+00:00 app[web.1]: Rendered shared/_footer.html.haml (21.8ms)
2012-10-09T19:54:46+00:00 app[web.1]: Completed 500 Internal Server Error in 1374ms (Views: 167.4ms | ActiveRecord: 54.5ms)
2012-10-09T19:54:46+00:00 heroku[router]: GET www.picpler.com/places dyno=web.1 queue=0 wait=0ms service=1779ms status=500 bytes=5879
2012-10-09T19:54:46+00:00 heroku[router]: GET www.picpler.com/assets/application-b1a625acbad7bb91815d78c9195ab079.css dyno=web.1 queue=0 wait=1ms service=82ms status=200 bytes=156193
2012-10-09T19:54:46+00:00 heroku[router]: GET www.picpler.com/assets/application-49e2a5e977547ad2ab276eede7660f58.js dyno=web.1 queue=0 wait=0ms service=15ms status=200 bytes=384722
2012-10-09T19:54:49+00:00 heroku[router]: GET www.picpler.com/assets/picpler-icons.png dyno=web.1 queue=0 wait=0ms service=11ms status=200 bytes=35891
@yangtheman
yangtheman / gist:3861115
Created October 9, 2012 20:08
Precompiling assets
yangtheman:~/ror/picpler(master)$ RAILS_ENV=production bundle exec rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/yangtheman/ror/picpler/Rakefile:7)
/Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.ru
@yangtheman
yangtheman / gist:4743311
Last active December 12, 2015 08:19
Installing Ruby 1.9.3 on Mountain Lion
# Install gcc-4.2.1 via brew
yangtheman:~$ brew install apple-gcc42
==> Downloading http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
######################################################################## 100.0%
==> Caveats
NOTE:
This formula provides components that were removed from XCode in the 4.2
release. There is no reason to install this formula if you are using a
@yangtheman
yangtheman / gist:5879742
Created June 27, 2013 19:48
mongoid.yml
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: vstandup_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
@yangtheman
yangtheman / gist:7594851
Last active December 29, 2015 01:39
My ship wars code
function reset() {
turnTo(enemyBearing());
fire(enemyBearing());
turnTo(randomAngle());
warp(5);
}
var i = 0;
function update() {