rails new store-backend
gem 'spree_backend', github: 'spree/spree'
function format_time(date_obj) { | |
// formats a javascript Date object into a 12h AM/PM time string | |
var hour = date_obj.getHours(); | |
var minute = date_obj.getMinutes(); | |
var amPM = (hour > 11) ? "pm" : "am"; | |
if(hour > 12) { | |
hour -= 12; | |
} else if(hour == 0) { | |
hour = "12"; | |
} |
1. master> git pull origin master | |
2. master> git branch temp_branch | |
3. master> git checkout temp_branch | |
4. temp_branch> ...Do your stuff and commit... | |
5. temp_branch> git checkout master | |
6. master> git pull origin master | |
7. master> git checkout temp_branch | |
8. temp_branch> git rebase master | |
9. temp_branch> git checkout master | |
10. master> git merge temp_branch |
class Post < ActiveRecord::Base | |
attr_accessible :body, :price, :title | |
validates_presence_of :title | |
validates_length_of :title, minimum: 10 | |
validates_presence_of :body | |
validates_numericality_of :price, greater_than: 0 | |
end |
#!/bin/bash | |
TOKEN=phonegap-build-access-token | |
APP_ID=phonegap-build-app-id | |
PROGRESS_FILE=/tmp/$TOKEN-progress | |
echo "" > $PROGRESS_FILE | |
tail -f $PROGRESS_FILE & | |
curl -X PUT -F file=@$1 https://build.phonegap.com/api/v1/apps/$APP_ID?auth_token=$TOKEN -o /tmp/$TOKEN-progress --progress-bar | |
kill $! |
import Relay, { | |
RootContainer, | |
Route | |
} from 'react-relay' | |
class SeasonRoute extends Route { | |
static paramDefinitions = {}; | |
static queries = { | |
currentSeason: () => Relay.QL`query { currentSeason }`, |