Skip to content

Instantly share code, notes, and snippets.

@andikan
andikan / cm.rb
Created September 20, 2012 10:15
for parsing json
#!/usr/bin/env ruby
# encoding: UTF-8
require 'json'
#require 'mysql2'
require 'geocoder'
Geocoder.configure do |config|
# geocoding service request timeout, in seconds (default 3):
config.timeout = 10
@andikan
andikan / install-flow
Created September 21, 2012 13:57
ec2 environment
http://ggd.github.com/blog/2012/07/20/deploy-rails-3-with-apache-mysql-passenger-capistrano-to-ec2/
http://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger
#ruby :
sudo apt-get install ruby1.9.1-full
#simple compiler
sudo apt-get install build-essential
#mysql
sudo apt-get install mysql-server mysql-common mysql-client libmysqlclient-dev
#ruby mysql adapter
@andikan
andikan / organic-2013-1-13.md
Created January 13, 2013 13:33
organic meeting 2013/1/13
@andikan
andikan / fireboxdescription.txt
Created January 26, 2013 05:13
firebox description
火狐轟炸客。
Firefox OS 唯一行動投擲器,可以親自施放煙火,
在家在宅也能施放煙火,跨年不用人擠人,享受最自在的甩動投擲樂趣。
把不開心的事都丟出去,變成絢麗的煙火隨著灰燼煙消而去。
FirebBox, throwing hand grenades to Taipei 101 !

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@andikan
andikan / Rakefile
Created July 18, 2013 09:49 — forked from scottwb/Rakefile
SSH_USER = 'root'
SSH_HOST = 'www.example.com'
SSH_DIR = '/var/www/html/www.example.com'
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("middleman build --clean")
puts status ? "OK" : "FAILED"
end
@andikan
andikan / 006.c
Created August 3, 2013 18:48 — forked from davidwparker/006.c
#include "screencasts.h"
/* Globals */
double dim=3.0; /* dimension of orthogonal box */
char *windowName = "OpenGL screenscasts 6: Drawing in 3d part 1: GLUT objects";
int windowWidth=500;
int windowHeight=450;
/* Various global state */
/* Toggles */

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'