First, add gem 'web-console', '~> 2.0'= to the =:development
group in
your Gemfile and run bundle install
(it won’t have been included when
you upgraded Rails). Once it’s been installed, you can simply drop a
reference to the console helper (i.e., <%
console %>=) into any view
you want to enable it for. A console will also be provided on any error
This file contains 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
(def country-list | |
{:fi {:default {:full 3900 :big 2600 :small 1300}} | |
:de {:default {:full 2400 :big 1200 :small 600}} | |
:uk {:default {:full 4200 :big 2800 :small 1400} | |
:london {:full 5700 :big 3800 :small 1900}}}) | |
(defn country-allowance | |
([country] | |
(country-allowance country "default")) | |
([country city] |
Here's a list of the interactive Emacs Lisp functions, provided by projectile:
Keybinding | Description |
---|---|
C-c p f | Display a list of all files in the project. With a prefix argument it will clear the cache first. |
C-c p F | Display a list of all files in all known projects. |
C-c p 4 f | Jump to a project's file using completion and show it in another window. |
C-c p d | Display a list of all directories in the project. With a prefix argument it will clear the cache first. |
This file contains 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
#!/usr/local/bin/python | |
""" | |
To use this script, you must be in the root directory of a Rails project that | |
is using git. You should also make sure that your directory does not contain any | |
uncommitted changes. Then run: | |
$ python rails_switch_branch.py name_of_another_branch | |
Running the above will do the following: |
This file contains 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
language: ar | |
days: | |
sunday: "الأحد" | |
monday: "الاثنين" | |
tuesday: "الثلاثاء" | |
wednesday: "الأربعاء" | |
thursday: "الخميس" | |
friday: "الجمعة" | |
saturday: "السبت" |
This file contains 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
Credit card: 5105105105105100 | |
CVV: 555 |
This file contains 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
I just updated to #mavericks, and here are notes (in case someone else is doing the update): | |
#mavericks | |
1. Terminal stopped working, might be because of ZSH. I had to go to Terminal -> Preferences -> Startup -> Shells open with: Command: /bin/zsh | |
2. Xcode needs to be updated to get RVM working. Update Xcode and run it once to finalize the update. | |
3. Remove all rubies `rvm list ; rvm remove ... ;` | |
4. Remove RVM `rvm implode` | |
5. Update brew `brew update` | |
6. Run `brew doctor` and resolve all issues |
This file contains 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
[alias] | |
clean-branches = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" |
This file contains 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
Dir.glob("app/**/*").select { |filename| ["rb", "js", "css", "scss", "erb", "haml", "yml"].include? filename.split(".").last }.each { |filename| | |
stripped = `git stripspace < #{filename}` | |
File.open(filename, 'w') { |file| file.write(stripped) } | |
} |
NewerOlder