Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Add to .gitignore file | |
node_modules | |
Then call: | |
git rm -r --cached node_modules | |
git commit -m "Remove node_modules now that they're ignored!" | |
git push origin master |
db:migrate runs (single) migrations that have not run yet. | |
db:create creates the database | |
db:drop deletes the database | |
db:schema:load creates tables and columns within the (existing) database following schema.rb | |
db:setup does db:create, db:schema:load, db:seed | |
db:reset does db:drop, db:setup |
rails g scaffold Post title:string body:text | |
rake db:migrate |
var btn = document.getElementsByClassName('toggle'); | |
for (var i = 0; i < btn.length; i++) { | |
btn[i].addEventListener('click', function(event) { | |
event.preventDefault(); | |
this.classList.toggle('toggled'); | |
}); | |
} |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
1. Clone the repository | |
2. npm i in the directory | |
3. npm start | |
npm, gulp, grunt -> build tools | |
bower works only on frontend | |
npm works full stack | |
sudo for installing programs to get access | |
npm install gulp-sass --save-dev | |
var gulp = require('gulp'); |
# ... | |
gem 'carrierwave' | |
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL |
Say you want to generate a new rails application that uses postgresql:
rails new my_awesome_app -d=postgresql
next you may want to use a generator to generate a model and a migration file:
cd my_awesome_app
rails generate model product name:string
and in the routes.rb file add the following to setup standard crud routes