Skip to content

Instantly share code, notes, and snippets.

View pauliinasol's full-sized avatar

Pauliina pauliinasol

  • General Assembly
  • Melbourne
View GitHub Profile
@pauliinasol
pauliinasol / remove-node_modules
Created November 27, 2018 10:02 — forked from cassidoo/remove-node_modules
Remove node_modules from git
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
@pauliinasol
pauliinasol / Rake commands
Created May 16, 2018 04:04
Notes on rake commands
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
@pauliinasol
pauliinasol / toggle.js
Created August 11, 2016 12:48
Javascript toggle class
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');
});
}
@pauliinasol
pauliinasol / README.md
Created May 31, 2016 08:51 — forked from chrisjacob/README.md
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

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

The Result

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');
@pauliinasol
pauliinasol / Gemfile
Created May 16, 2016 00:48 — forked from epoch/Gemfile
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
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