Skip to content

Instantly share code, notes, and snippets.

View pake007's full-sized avatar

Jimmy Huang pake007

View GitHub Profile
@pake007
pake007 / wkhtmltopdf_compiling.md
Created April 16, 2013 08:11
Steps of compling

I used the following instructions from Nicholas to compile wkhtmltopdf & wkhtmltoimage

For those installing on Mac OS X 10.6.8, these are the steps I followed to get a successful build:

$ git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt $ cd wkhtmltopdf-qt $ git checkout staging

Perform a find/replace across all files in the 'wkhtmltopdf-qt' folder (I did this using BBEdit): FIND: MACOSX_DEPLOYMENT_TARGET = 10.4

@pake007
pake007 / fibonacci.go
Last active December 15, 2015 21:19
A Tour of Go, my code of exercises
// Implement fibonacci by using go closure
package main
import "fmt"
func fibonacci() func(int) int {
var sum1, sum2 int = 0, 1
return func(x int) int {
if x == 0 {
@pake007
pake007 / 1_add_owner_to_delayed_jobs.rb
Last active December 14, 2015 04:38
Customize delayed_job for sending email, create association between the job and the object, so that can quickly find the object's jobs.
# db/migrate/add_owner_to_delayed_jobs.rb
class AddOwnerToDelayedJobs < ActiveRecord::Migration
def self.up
add_column :delayed_jobs, :owner_type, :string
add_column :delayed_jobs, :owner_id, :integer
add_index :delayed_jobs, [:owner_type, :owner_id]
end
def self.down
@pake007
pake007 / WordPress on Mac OS X.md
Created December 20, 2011 03:35
Install and Configure WordPress on Mac OS X Snow Leopard Step-By-Step

It is very convenient to install and configure WordPress on Max OS X Snow Leopard or higher version like Lion, because it already builds an apache2 server and php5 in the system, you just need to configure them and your wordpress site can be run!

Install WordPress

  • Download the latest version of WordPress (3.3 as of this writing)

  • Extract and copy the "wordpress" folder to your "Sites" folder. So, in my case the full path to WordPress is: /Users/jimmy/Sites/wordpress you can rename the folder as your wanted.

@pake007
pake007 / master.css
Created November 16, 2011 15:00
assets css sample
/* line 6, /home/pat/www/terra_nova/vendor/gems/wulin_master/vendor/assets/stylesheets/body.sass */
body {
background: #d3dadf;
font-family: "Helvetica", "Arial", sans-serif;
font-size: 62.5%;
}
/* line 11, /home/pat/www/terra_nova/vendor/gems/wulin_master/vendor/assets/stylesheets/body.sass */
.grid_container {
float: left;
@pake007
pake007 / .rspec
Created August 15, 2011 11:06
Configuration for Spork & Rspec2 & autotest
--drb
-c
@pake007
pake007 / seeds.rb
Created July 21, 2011 07:05
Countries db seed
[
{ :name => 'Afghanistan', :code => 'AF' },
{ :name => 'Aland Islands', :code => 'AX' },
{ :name => 'Albania', :code => 'AL' },
{ :name => 'Algeria', :code => 'DZ' },
{ :name => 'American Samoa', :code => 'AS' },
{ :name => 'Andorra', :code => 'AD' },
{ :name => 'Angola', :code => 'AO' },
{ :name => 'Anguilla', :code => 'AI' },
{ :name => 'Antarctica', :code => 'AQ' },