Skip to content

Instantly share code, notes, and snippets.

# Let's assume that google has a Location header like the following: (It does)
# Location: http://www.google.com/
# Let's create a new Response using RestClient.
response = Webbed::Response.new(RestClient.get 'http://google.com')
# Now, we can do this:
response.location # => "http://www.google.com/"
# Let's follow that URL.
# Install homebrew
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
# Install git
brew install git
# Update homebrew
brew update
# Install homebrew packages
@kern
kern / webhook_callbacks.rb
Created July 19, 2011 17:02
WebhookCallbacks for God
module God
module Contacts
class WebhookCallbacks < Webhook
def notify(message, time, priority, category, host)
data = {
:message => message,
:time => time,
:priority => priority,
:category => category,
:host => host
# First, delete all the other bhrobotics directories.
# Then copy and paste these commands in order:
git clone git@github.com:CapnKernul/bhrobotics.com.git
cd bhrobotics.com
gem install bundler
gem install rails
bundle install
bundle exec rake db:migrate
rails server
#include "Time.h"
#include "SD.h"
#define SAMPLE_TIME 40
#define MAX_ENTRIES 100
#define MAX_ENTRIES_PER_FILE 25000
#define BUTTON_PIN 9
int running = 0;
int entries = 0;
int entries_in_file = 0;
#include "Time.h"
#include "SD.h"
#define SAMPLE_TIME 40
#define ENTRIES_PER_FILE 25000
#define DELAY_BETWEEN_FILES 2000
#define BUTTON_PIN 9
int running = 0;
int entries = 0;
File file;
@kern
kern / gist:1910457
Created February 25, 2012 20:32
Problem Report for iWebInspector (XCode 4.3, Lion)
Process: iWebInspector [83536]
Path: /Applications/iWebInspector.app/Contents/MacOS/iWebInspector
Identifier: mobi.firt.iWebInspector
Version: 0.9 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [300]
Date/Time: 2012-02-25 12:28:36.535 -0800
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9
@kern
kern / slow_virtus_spec.rb
Created October 17, 2012 10:05
How would you test Person in isolation?
require "virtus"
require "rspec/autorun"
class Address < Virtus::Attribute::Object
primitive String
def coerce(value)
# Simulate a slow call to an external service that normalizes the
# address's format.
sleep 1
@kern
kern / hh-descomp.md
Last active August 29, 2015 14:12
Hackathon Hackers Design Competition

Hackathon Hackers Design Competition

View the submissions and vote!

HH and HH Design have teamed up to host the first Hackathon Hackers Design Competition!

The cover photo for Hackathon Hackers is OLD. Like ancient. Like it’s the same one uploaded the day this group was created. It’s time for an update.

The creativity of the hacker community knows no bounds. We’re hoping you can come up with cover photo concepts that capture the unique ethos of student hackathons. So take some time out of your holiday break, spin up your favorite image editor, and try your hand at branding HH.

Startup@Berkeley Posting Guidelines

Anything relating to startups, entrepreneurship, innovation, technology, hacking, design, business, or related fields is fair game for discussion in the group. The focus is on the Bay Area and Berkeley specifically, so please make sure events are accessible to students at UC Berkeley.

We require that all posts must be approved by moderators to maintain a high standard of content. Comment as much as you'd like, however!

  • First and foremost, be kind to one another.
  • Please don't post job listings. This is not a recruiting platform. You may, however, recruit for your campus organization.
  • Moderators may remove posts and comments that are of low quality or are deemed harmful to the community.
  • Avoid prejudice in all its forms. Racism, sexism, homophobia, and any other demeaning behavior will not be tolerated.