# supports only notice and alert by default
# the rest has to go into flash hash
redirect_to :index, notice: "success"
redirect_to :new, notice: "errors"
redirect_to :new, flash: { success: "yeah" }
flash[:info] = "updated"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # lib/templates/active_record/model/model.rb | |
| <% module_namespacing do -%> | |
| class <%= class_name %> < <%= parent_class_name.classify %> | |
| # keep the default scope first (if any) | |
| # constants come up next | |
| # afterwards we put attr related macros | |
| # followed by association macros |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if &compatible | |
| set nocompatible | |
| end | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim/ | |
| call vundle#begin() | |
| " Let Vundle manage Vundle | |
| Plugin 'gmarik/Vundle.vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo -i | |
| cd | |
| apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y | |
| wget http://www.imagemagick.org/download/ImageMagick.tar.gz | |
| tar xzvf ImageMagick-6.8.9-1.tar.gz | |
| cd ImageMagick-6.8.9-1/ | |
| ./configure --prefix=/opt/imagemagick-6.8 && make | |
| checkinstall |
You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.
- postgresql
- postgresql-client
- libpq-dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Country | CountryCode | Currency | Code | |
|---|---|---|---|---|
| New Zealand | NZ | New Zealand Dollars | NZD | |
| Cook Islands | CK | New Zealand Dollars | NZD | |
| Niue | NU | New Zealand Dollars | NZD | |
| Pitcairn | PN | New Zealand Dollars | NZD | |
| Tokelau | TK | New Zealand Dollars | NZD | |
| Australian | AU | Australian Dollars | AUD | |
| Christmas Island | CX | Australian Dollars | AUD | |
| Cocos (Keeling) Islands | CC | Australian Dollars | AUD | |
| Heard and Mc Donald Islands | HM | Australian Dollars | AUD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'test_helper' | |
| # testing rake task app:awesome_report | |
| # defined in file lib/tasks/app/awesome_report.rake | |
| describe 'App::AwesomeReportTaskTest' do | |
| it 'generates the awesomeness report' do | |
| subject.invoke | |
| assert File.exists?('awesomeness_report.csv') | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="redux react todo list example <filter todos>"> | |
| <script src="https://fb.me/react-0.14.7.min.js"></script> | |
| <script src="https://fb.me/react-dom-0.14.7.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="redex react todo list example add todo"> | |
| <script src="https://fb.me/react-0.14.7.min.js"></script> | |
| <script src="https://fb.me/react-dom-0.14.7.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> |
Contours of San Francisco overlayed over OpenStreeMap vector tiles using code from mbostock's vector tiles with multiple layers example. View the hi-res file
See gist for code used to generate contours.