Skip to content

Instantly share code, notes, and snippets.


Michael kagemusha

View GitHub Profile
kagemusha / gist:1391549
Created Nov 24, 2011
SSL_connect...certificate verify failed Error on OSX using Rails
View gist:1391549
If running rails ... commands on OSX you get:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
1. Install cert
sudo port install curl-ca-bundle
2. When running rails command, do
kagemusha / gist:1433863
Created Dec 5, 2011
iOS Phonegap APP: Whitelist URL Error
View gist:1433863
Tested: PhoneGap 1.2, XCode 4.2
If you are trying to connect to an external server from your
appYou must add the host (e.g. to your
PhoneGap.plist file.
In XCode:
1) Find PhoneGap.plist: should be in dir <your_app>/Supporting Files
2) Find or create the ExternalHosts prop
3) The ExternalHosts prop should be an array. Add an item an input your
kagemusha / gist:1434402
Created Dec 5, 2011
JQuery Autocomplete with Rails 3.1 Example
View gist:1434402
Tested on: Rails 3.1.3, jquery-rails (1.0.18), jquery-ui-1.8.16
1. Create form with text field to be autocompleted
2. Hook up autocomplete
3. Write an autocomplete function in your Rails controller to return data
4. Create a rails route
kagemusha / gist:1443744
Created Dec 7, 2011
Install Postgres pg Ruby Gem on Snow Leopard
View gist:1443744
Tested on: pg (0.11.0) OS X Snow Leopaard
export PATH=/opt/local/lib/postgresql84/bin:${PATH}
env ARCHFLAGS="-arch x86_64" gem install pg
where postgresql84 is install dir
kagemusha / gist:1477824
Created Dec 14, 2011
Heroku Custom Domain w Godaddy and Google Apps
View gist:1477824
Heroku Setup
1. Install Custom Domain Plugin for your app
heroku addons:add custom_domains
2. Add domain names
heroku domains:add
GoDaddy Setup
1. Go to your domain under your account
View gist:1478469
(courtesy OpenGotham)
Setting up a local git clone of project
git clone<project>.git
Branching Workflow
All work is done in topic branches. Generally a topic branch maps directly to a feature requests.
Before a developer begins to work on code they should :
git co -b wip_short_desc_of_intended_wk
kagemusha / gist:1559115
Created Jan 4, 2012
jQuery UI Tabs - Basic Setup (Haml,Coffeescript)
View gist:1559115
Tested on: jquery-ui-1.8.16
To set up, need:
1) an HTML div enclosing the tabs (as a ul) and pages,
2) Javascript initialization function $("..").tabs({options})
- consists of enclosing div, a %ul which has links to pages, and tab pages as divs
- link hrefs correspond to tab page ids
kagemusha / gist:1661626
Created Jan 23, 2012
JQuery Datatables Errors
View gist:1661626
Seen on: Datatables 1.8.x
1. c[b[0]] is undefined
Check aoColumns prop. E.g. if below not defined will cause error. If are using
"aoColumns": [
{ "sWidth": '200px', "mDataProp": "" },
If are setting col val in "fnRowCallback" prop, set mDataProp to null to avoid this problem.
kagemusha / gist:1668948
Created Jan 24, 2012
JQuery UI Date Formatting
View gist:1668948
Ref: jquery-rails 1.0.19 (jquery ui 1.8x)
$.datepicker.formatDate 'yy-mm-dd', (new Date(obj.created_at))
If u need time need to do it separately
kagemusha / gist:1715379
Created Feb 1, 2012
Heroku Rails Cedar Commands
View gist:1715379
Database (PG):
reset db: heroku pg:reset DATABASE_URL
- type exactly like this DATABASE_URL is assigned by Heroku
- will ask you to confirm your app db)
db:* heroku run rake db:*
- e.g. heroku run rake db:migrate
You can’t perform that action at this time.