Run the following command:
git config --global url.ssh://git@github.com/.insteadof gh:This will tell Git to expand the gh: URL scheme to ssh://git@github.com. You can then checkout a repo using the shorter syntax:
| dirs = ["output/test/deepdir", "testdir", "another"] | |
| task :default => dirs | |
| dirs.each do |dir| | |
| directory dir | |
| end | |
| # fjean@Prometheus ~/dev/gist-806422 | |
| # master* $ rake -t -v [13:22:23] |
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| # setup | |
| # | |
| require 'fileutils' | |
| script = File.expand_path(__FILE__).gsub(%r|\breleases/\d+\b|, 'current') | |
| script_dir = File.dirname(script) | |
| rails_root = File.dirname(script_dir) |
| gem 'redcarpet' |
Run the following command:
git config --global url.ssh://git@github.com/.insteadof gh:This will tell Git to expand the gh: URL scheme to ssh://git@github.com. You can then checkout a repo using the shorter syntax:
| require 'right_aws' | |
| def instances_from_ec2(load_balancer = nil) | |
| load_balancer ||= aws_load_balancer | |
| payload = elb.describe_load_balancers(load_balancer) | |
| instances = ec2.describe_instances payload.first[:instances] | |
| instances.collect{|instance| instance[:dns_name] if (instance[:aws_state] == 'running')} | |
| end | |
| require 'right_aws' | |
| def instances_from_ec2(load_balancer = nil) | |
| load_balancer ||= aws_load_balancer | |
| payload = elb.describe_load_balancers(load_balancer) | |
| instances = ec2.describe_instances payload.first[:instances] | |
| instances.collect{|instance| instance[:dns_name] if (instance[:aws_state] == 'running')} | |
| end | |
| def elb | |
| @elb ||= RightAws::ElbInterface.new(aws_access_key_id, aws_secret_access_key, :region => 'us-west-1') |
| set :raise_errors, true | |
| set :show_exceptions, true if development? | |
| require 'exceptional' | |
| use Rack::Exceptional, "11a42f81f3652f34d226904c671659d7cedb44d9" unless (Rails.env.development? || Rails.env.test?) | |
| desc "Imports all existing Salesforce accounts" | |
| task :households => :environment do |t| | |
| accounts = Salesforce::Household.all | |
| start = 0 | |
| size = 100 | |
| loop do | |
| puts "Loading from #{start} to #{start + size}" | |
| accounts[start...(start + size)].each do |account| | |
| SnuggHome::SalesforceImporter.import_home(account) | |
| end |
So you think you wanna be a web developer... Fork this, update your copy with answers. They don't need to be precise - pseudo-code is fine in most cases. Some questions don't have correct answers.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>net.fredjean.cleandownloads</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>mv</string> | |
| <string>~/Downloads/*(mw+1) ~/.Trash</string> |