- Setup your icloud account (if any)
- Instalar chrome
- instalar dropbox
- instalar onepassword
- Bajar xcode
- instalar iterm2
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
| Ubuntu 10.04 | |
| -- install ruby dependencies | |
| sudo apt-get install curl build-essential git-core zlib1g-dev libssl-dev libreadline5-dev libcurl4-openssl-dev | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| -- install RVM | |
| sudo bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) |
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
| <!-- I took this code from somewhere, just can recall now. --> | |
| <script type="text/javascript"> | |
| function toggleGrid() { | |
| var toggle = document.getElementById('toggleGrid'); | |
| var container; | |
| if(toggle.innerHTML == 'Hide Grid') { | |
| toggle.innerHTML = 'Show Grid'; | |
| ripClass(''); | |
| } |
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
| //this is for the preloader gif | |
| .loading{ | |
| position: fixed; | |
| right: 5px; | |
| bottom: 5px; | |
| display:none; | |
| } |
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
| This are some common conventions for localization files in ruby on rails. | |
| Most of this can be found in the rails guides. | |
| I basically separate the files in directories related to where they will be used. Adding this line to config/application.rb so the files gets loaded correctly. | |
| config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**/*.{rb,yml}').to_s] | |
| Models | |
| Views |
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
| This conventions are the ones I use when developing models. | |
| Basically all the rspec generated file is separated in sections depending on the things the model does, validates and sets. | |
| Validations | |
| Relations | |
| instance methods | |
| scopes | |
| All of those tested separately. |
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
| Given a controller file, with some actions in it... This gist defines how I like to organize the rspec controller 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
| #!/usr/bin/env ruby | |
| LETTERS = { | |
| :a => 'ka', | |
| :b => 'zu', | |
| :c => 'mi', | |
| :d => 'te', | |
| :e => 'ku', | |
| :f => 'lu', | |
| :g => 'ji', |
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
| #This module lets us create a query string from a hash or array. | |
| module QueryParams | |
| def self.encode(value, key = nil, sep = '&') | |
| case value | |
| when Hash then value.map { |k,v| encode(v, append_key(key,k), sep) }.join(sep) | |
| when Array then value.map { |v| encode(v, "#{key}[]", sep) }.join(sep) | |
| when nil then '' | |
| else | |
| if value.to_s.present? | |
| "#{key}=#{CGI.escape(value.to_s)}" |
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
| // Receives the selector of a form and return the params as an array | |
| // Example: | |
| // ["date=2013-01-11", "transactions[][transaction_type]=withdrawal", "transactions[][ammount]=", "transactions[][description]="] | |
| function formAsParams(formSelector){ | |
| var array = $(formSelector).serializeArray(), | |
| params = _.reduce(array, function(memo, elem){ memo.push(elem.name + "=" + elem.value); return memo; }, []); | |
| return params; | |
| } | |
| // Given a form with data-attributes data-post-to and data-method, it will do an ajax request to the url |
OlderNewer