As configured in my dotfiles.
start new:
tmux
start new with session name:
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| // 1. How to check if one array has all elements of another? | |
| var importedEmails = ['[email protected]', '[email protected]'], | |
| existingEmails = ['[email protected]', '[email protected]', '[email protected]']; | |
| if(!_.difference(importedEmails, existingEmails).length) console.log('already imported') | |
| // > already imported | |
| // ********************************************************** | |
| // 2. How to find what elements are common to two arrays? |
| curl -L https://www.atom.io/api/updates/download -A "Atom/0.1 CFNetwork/1.5" > Atom.zip | |
| unzip Atom.zip | |
| mv Atom.app /Applications/ |
| gem 'will_paginate' |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/usr/bin/env /usr/local/rvm/wrappers/ruby-1.9.2-p290@puppet/ruby | |
| ## Used by M/Monit to send prowl alerts | |
| require 'rubygems' | |
| require 'optparse' | |
| # everyone's API keys | |
| contact_info = { | |
| "grant"=>{"key"=>"my_api_key"} |
Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
| require 'mechanize' | |
| @username = '[email protected]' | |
| @password = 'hi2u' | |
| @download_path = File.expand_path 'downloads' | |
| @wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt' | |
| unless File.directory? @download_path | |
| puts "@{download_path} doesn't exist!" | |
| exit |
| /path/to/unicorn/log/unicorn.stderr.log | |
| /path/to/production/log/production.log | |
| { | |
| daily | |
| missingok | |
| rotate 180 | |
| compress | |
| dateext | |
| # this is important if using "compress" since we need to call |
| # -*- encoding : utf-8 -*- | |
| set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
| namespace :deploy do | |
| namespace :assets do | |
| desc <<-DESC | |
| Run the asset precompilation rake task. You can specify the full path \ | |
| to the rake executable by setting the rake variable. You can also \ |