http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
http://guides.rubyonrails.org/migrations.html
| [ | |
| {"caption": "Toggle Shown Spaces", "command": "toggle_shown_spaces"} | |
| ] |
| ActiveRecord cheat sheet / EXAMPLES | |
| INSTALL | |
| ======= | |
| $ gem install activerecord | |
| in GEMFILE: gem ‘activerecord’ | |
| REQUIRE | |
| ======= | |
| require ‘active_record’ |
| String.prototype.toSlug = function(){ | |
| st = this.toLowerCase(); | |
| st = st.replace(/[\u00C0-\u00C5]/ig,'a') | |
| st = st.replace(/[\u00C8-\u00CB]/ig,'e') | |
| st = st.replace(/[\u00CC-\u00CF]/ig,'i') | |
| st = st.replace(/[\u00D2-\u00D6]/ig,'o') | |
| st = st.replace(/[\u00D9-\u00DC]/ig,'u') | |
| st = st.replace(/[\u00D1]/ig,'n') | |
| st = st.replace(/[^a-z0-9 ]+/gi,'') | |
| st = st.trim().replace(/ /g,'-'); |
| /* | |
| * Inspired by: | |
| * http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery | |
| * | |
| * This script is ideal for getting specific class depending on device width | |
| * for enhanced theming. Media queries are fine in most cases but sometimes | |
| * you want to target a specific JQuery call based on width. This will work | |
| * for that. Be sure to put it first in your script file. Note that you could | |
| * also target the body class instead of 'html' as well. | |
| * Modify as needed |
| /* Solarized Dark | |
| For use with Jekyll and Pygments | |
| http://ethanschoonover.com/solarized | |
| SOLARIZED HEX ROLE | |
| --------- -------- ------------------------------------------ | |
| base03 #002b36 background | |
| base01 #586e75 comments / secondary content |
| <!doctype html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script> | |
| <meta charset="UTF-8"> | |
| <title>Example Google Map</title> | |
| </head> | |
| <body> | |
| <div id="map-canvas" style="height:400px; width:600px;"></div> | |
| <script> |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>comment</key> | |
| <string> | |
| TODO: unresolved issues | |
| text: |
| # Sublime Text 3 languages list: | |
| ls -1 /Applications/Sublime\ Text.app/Contents/MacOS/Packages/ | |
| # Remove all default Sublime Text 3 snippets for Python language | |
| export ST3_LANG="Python" | |
| mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/ | |
| unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/$ST3_LANG.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | while read f; do touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/$f; done | |
| unset ST3_LANG |
| // ---- | |
| // Sass (v3.3.4) | |
| // Compass (v1.0.0.alpha.18) | |
| // ---- | |
| // Capitalize string | |
| // -------------------------------------------------------------------------------- | |
| // @param [string] $string | |
| // -------------------------------------------------------------------------------- | |
| // @return [string] |