Skip to content

Instantly share code, notes, and snippets.

Jim Chang zxcvbnm4709

Block or report user

Report or block zxcvbnm4709

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
View 20110722081111_create_members.rb
class CreateMembers < ActiveRecord::Migration
def self.up
create_table :members do |t|
t.integer :family_id
t.string :name
t.integer :tree_position_id
t.string :gender
t.datetime :birthday
t.string :bloodtype
@zxcvbnm4709
zxcvbnm4709 / gist:1109012
Created Jul 27, 2011
brew install mysql
View gist:1109012
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
@zxcvbnm4709
zxcvbnm4709 / gist:1109088
Created Jul 27, 2011
"$(brew --prefix mysql)"/bin/mysql_secure_installation
View gist:1109088
jim@mbp: ~$ "$(brew --prefix mysql)"/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
@zxcvbnm4709
zxcvbnm4709 / whatever.rb
Created Nov 13, 2011
一般來說,class static variable的accessor怎麼寫
View whatever.rb
# 如果你指的class static variable是@@a這種
# 我會這麼寫(至於多數人怎麼寫我就不清楚了...sorry = =")
class A
@@class_var = 'I am A'
def self.class_var
@@class_var
end
end
@zxcvbnm4709
zxcvbnm4709 / gist:1398872
Created Nov 28, 2011
rake assets:precompile
View gist:1398872
jimchang ~/projects/tw-voting[master ☠]$ rake assets:precompile
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
mkdir -p /Users/jimchang/projects/tw-voting/public/assets
View site.css.sass.erb
@import "compass"
@import "preboot"
@import "compass-bootstrap/compass_bootstrap"
body
background: url(<%= asset_path 'background3.jpg' %>)
//background-color: #dedede
#main
//background-color: white
//+box-shadow(rgba(#dedede,0.5) 1px 0px 2px)
#header
@zxcvbnm4709
zxcvbnm4709 / gist:1399495
Created Nov 28, 2011
heroku logs 爆炸
View gist:1399495
2011-11-28T07:34:52+00:00 app[web.1]: => Booting WEBrick
2011-11-28T07:34:52+00:00 app[web.1]: => Rails 3.1.0 application starting in production on http://0.0.0.0:52360
2011-11-28T07:34:52+00:00 app[web.1]: => Call with -d to detach
2011-11-28T07:34:52+00:00 app[web.1]: => Ctrl-C to shutdown server
2011-11-28T07:34:52+00:00 app[web.1]:
2011-11-28T07:34:52+00:00 app[web.1]:
2011-11-28T07:34:52+00:00 app[web.1]: Started GET "/" for 114.24.63.172 at 2011-11-28 07:34:52 +0000
2011-11-28T07:34:52+00:00 app[web.1]: Processing by PollsController#index as HTML
2011-11-28T07:34:52+00:00 app[web.1]: Rendered common/_user_nav.html.erb (1.2ms)
@zxcvbnm4709
zxcvbnm4709 / RKObjectMapping.h
Created Jan 17, 2012
understanding object mapping of RestKit
View RKObjectMapping.h
//
// RKObjectMapping.h
// RestKit
//
// Created by Blake Watters on 4/30/11.
// Copyright 2011 Two Toasters. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RKObjectMappingDefinition.h"
View dabblet.html
<!-- content to be placed inside <body>…</body> -->
You can’t perform that action at this time.