Skip to content

Instantly share code, notes, and snippets.

@catermelon
catermelon / gist:f3b1d2e9e4d094d118fa
Last active August 29, 2015 14:12
Things to do in SF

Weather

So the SF pasttime isn't baseball or anything like that, it's laughing at tourists who wear shorts. All the visions of warm, beachy California are lies spread by the Los Angeles tv industry. SF can be cold and windy even in summer (actually especially in summer, the land warms up and causes the fog to roll in) and the fog is beautiful but it's FRICKIN COLD. I always bring a jacket to SF no matter what time of year it is. It can be 30 deg C maybe 20 miles away and 10 degrees C in SF. No joke.

Food

SF has awesome food, with a lot of Asian and Mexican influence. Here's a great list from all price ranges: http://www.sfgate.com/food/top100/2014/

Pay particular attention to Mexican/Central and South American food, since I know the UK has great Asian food but not Mexican. The burrito is a Californian staple. Try the al pastor and the carnitas.

#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)
file "/etc/apt/sources.list.d/my-ppa.list" do
content "deb http://ppa.launchpad.net/USER/ppa/ubuntu lucid main"
owner "root"
group "root"
mode 0644
end
execute "Add PPA key" do
command "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY"
not_if "apt-key list | grep -xq '.*1024R/KEY.*'"
@apsoto
apsoto / knife-config.staging.rb
Created November 22, 2010 19:21
Managing different chef environments using git branches
log_level :debug
log_location STDOUT
validation_client_name 'channels-staging-validator'
validation_key './.chef/channels-staging-validator.pem'
chef_server_url 'https://api.opscode.com/organizations/channels-staging'
cache_options( :path => './.chef/channels-staging-checksums' )
@mm53bar
mm53bar / application_controller.rb
Created December 23, 2010 20:31
Code to roll your own authentication!
class ApplicationController < ActionController::Base
include AuthenticateUser
before_filter :authenticate_user!
end
@jezdez
jezdez / custom_settings.py
Created December 28, 2010 12:08
support for legacy locations of app media (in APP/media/)
# Add this to your settings.py
STATICFILES_FINDERS += (
'mysite.finders.AppMediaFinder'
)
@progrium
progrium / urlfetch_intercept.py
Created February 9, 2011 06:15
wsgi_intercept for app engine's urlfetch
""" Monkey patch to hit wsgi apps when using urlfetch
This will monkey patch App Engine's urlfetch.fetch with a fetch that hits a local
wsgi app registered with add_intercept. This module is inspired by and borrows
code from the wsgi-intercept project, which doesn't work with App Engine.
This is intended only for the local SDK environment for unit tests.
Usage:
@jbz
jbz / knife.rb
Created February 16, 2011 17:08
knife.rb that switches Opscode orgs/validators based on git branch
# This knife.rb orig. provided by jtimberman@opscode.com - but any mistakes are mine!
current_dir = File.dirname(__FILE__)
platform = "https://api.opscode.com/organizations"
require 'grit'
branch = Grit::Repo.new("#{current_dir}/..").head.name
case branch
@ericflo
ericflo / twitter_to_convore.py
Created February 20, 2011 10:02
A small script which takes keywords to track on Twitter and streams them live into a Convore topic.
import base64
import httplib
import threading
import urllib
import tweepy
CONVORE_BOT_USERNAME = ''
CONVORE_BOT_PASSWORD = ''
CONVORE_TOPIC_ID = '7612'
@mikehale
mikehale / knife.rb
Created March 23, 2011 19:44
hook to cleanup useless metadata.json files
def cleanup_metadata_json
Dir["*cookbooks/**/metadata.json"].each do |json
FileUtils.rm_f json
end
end
cleanup_metadata_json
at_exit { cleanup_metadata_json }