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
| #include ActionController::Helpers and | |
| #provide your own Helper modules to the view using the 'helper' method | |
| #In my API application I created a RenderingController which acts as a superclass for all controllers that do render: | |
| class RenderingController < ApplicationController | |
| include AbstractController::Layouts | |
| include AbstractController::Translation | |
| include ActionController::ImplicitRender | |
| include ActionController::Helpers |
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
| <div ng-class="{ active: user.id == activeId }"> | |
| Dynamic | |
| </div> | |
| <!-- In this case active class will be added to the element as long as user.id matches activeId from the $scope object! --> |
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 apt-get install postgres | |
| sudo apt-get install postgres-contrib | |
| #/etc/postgresql/9.1/main/pg_hba.conf | |
| # "local" is for Unix domain socket connections only | |
| local all all trust | |
| sudo su | |
| passwd postgres #set password |
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
| "file path/level1/level2" xxx some="xxx" | |
| /location="(.*?)"/ |
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
| #faster bundle install | |
| https://github.com/rubygems/rubygems/issues/513#issuecomment-14964071 |
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
| tar xvzf file-1.0.tar.gz - to uncompress a gzip tar file (.tgz or .tar.gz) | |
| tar xvjf file-1.0.tar.bz2 - to uncompress a bzip2 tar file (.tbz or .tar.bz2) | |
| tar xvf file-1.0.tar - to uncompressed tar file (.tar) | |
| #x = eXtract, this indicated an extraction c = create to create ) | |
| #v = verbose (optional) the files with relative locations will be displayed. | |
| #z = gzip-ped; j = bzip2-zipped | |
| #f = from/to file ... (what is next after the f is the archive file) |
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
| setTimeout(function() { | |
| // rest of code here | |
| }, 2000); |
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
| git remote add heroku [email protected]:your-app.git |
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
| #centerme | |
| { | |
| position: absolute; | |
| left: 50%; | |
| top: 50%; | |
| /* You must set a size manually */ | |
| width: 100px; | |
| height: 50px; |
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
| $scope.$on('$routeChangeStart', function(next, current) { | |
| ... you could trigger something here ... | |
| }); |