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
| class Array | |
| def to_csv(csv_filename="hash.csv") | |
| require 'csv' | |
| CSV.open(csv_filename, "wb") do |csv| | |
| csv << first.keys # adds the attributes name on the first line | |
| self.each do |hash| | |
| csv << hash.values | |
| end | |
| end | |
| 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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
| # | |
| # UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs | |
| # just run "sudo trimforce enable" to activate the trim support from now on! | |
| # | |
| # Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
| # Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
| # | |
| # Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
| # | |
| # Alternative to http://www.groths.org/trim-enabler-3-0-released/ |
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
| RSpec.configure do |config| | |
| config.use_transactional_fixtures = false | |
| config.before(:suite) do | |
| DatabaseCleaner.clean_with :truncation | |
| end | |
| config.before(:each) do | |
| if example.metadata[:js] | |
| DatabaseCleaner.strategy = :truncation |
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 'fileutils' | |
| # Warning: The following deploy task will completely overwrite whatever is currently deployed to Heroku. | |
| # The deploy branch is rebased onto master, so the push needs to be forced. | |
| desc "Deploy app to Heroku after precompiling assets" | |
| task :deploy do | |
| deploy_branch = 'heroku' | |
| remote = 'heroku' | |
| deploy_repo_dir = "tmp/heroku_deploy" |
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
| # cap web:deploy:desable & cap web:deploy:enable | |
| server { | |
| ... | |
| if (-f $document_root/system/maintenance.html) { set $maintenance 1; } | |
| if ($request_uri ~* (jpg|jpeg|gif|js|css)$) { set $maintenance 0; } | |
| if ($maintenance) { rewrite ^(.*)$ /system/maintenance.html; break; } | |
| ... | |
| } |
NewerOlder