Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fredjean on github.
  • I am fredjean (https://keybase.io/fredjean) on keybase.
  • I have a public key ASDK7zUS30IIzvH92s50rEBFTwWxDj4zVhzwmpT8bW7BGAo

To claim this, I am signing this object:

@fredjean
fredjean / gist:6290421
Created August 21, 2013 04:47
Oh-My-Zsh Theme. 99.9% agnoster's theme with a small tweak at the end...
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
<?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>
@fredjean
fredjean / quiz-1.md
Created September 26, 2012 15:52 — forked from ahoward/quiz-1.md
quiz-1.md
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.

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
set :raise_errors, true
set :show_exceptions, true if development?
require 'exceptional'
use Rack::Exceptional, "11a42f81f3652f34d226904c671659d7cedb44d9" unless (Rails.env.development? || Rails.env.test?)
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')
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
@fredjean
fredjean / gist:3355455
Created August 15, 2012 03:30
Custom Git URL Handlers

Using a custom URL scheme for shorter GitHub URLs

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:

@fredjean
fredjean / Gemfile
Created August 14, 2012 21:04
Using Redcarpet on Middleman
gem 'redcarpet'