Skip to content

Instantly share code, notes, and snippets.

Andy Brett andrewpbrett

Block or report user

Report or block andrewpbrett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andrewpbrett on github.
  • I am andrewpbrett ( on keybase.
  • I have a public key ASDd5LCtn9pyrwc7dlZWJKRW1AUpoa64HdAuZi7f5Kvucwo

To claim this, I am signing this object:

View pocketboard.rb
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'cgi'
require 'redis'
require 'httparty'
pocket_username = YOUR POCKET USERNAME
page = Nokogiri::HTML(open("{pocket_username}"))
View camera.php
$s = @file_get_contents('php://input');
file_put_contents("/var/www/hackathon/camera.jpg", $s);
View validator.js
validDatapoint: function(datapoint) {
var re = /^\s*((?:(?:\d{1,2})\s+){1,3}|\^+\s+)((?:(?:\+|\-)?(?:\d+\.?\d*|\d*\.?\d+))|(?:\d+st[\d\.]*)|(?:(\d+)\:(\d\d)(?:\:(\d\d))?))(\s+\".*?\")?\s*$/;
if(datapoint.length > 0 && !re.test(datapoint)) {
return false;
else if (datapoint.match(re) &&
($.trim(datapoint.match(re)[1]) - 0 < 1 ||
$.trim(datapoint.match(re)[1]) - 0 > 31)) {
return false;
View user_spec.rb
describe User do
it "should add a user to an enrollment" do
plan = Plan.create(:name => "Aetna PPO")
don = User.create(:name => "Don")
don.plans << plan
don.enrollments.size.should == 1
betty = User.create(:name => "Betty")
betty.enrollments.size.should == 1
don.cousers.should include(betty)
View unfollowers.rb
# Simple script to send you email when someone unfollows you on twitter.
# Replace email on line 24 with the email you want to receive notifications at, and
# twitter handle on line 23 with your own (or whomever you want to track unfollows for).
# Set up a crontab to check however often you like. If someone follows and then unfollows you
# very quickly (within the interval), you won't get an email.
# Requires that you can send mail from the command line of the environment where
# you're running the script using mailx, e.g. `echo "body" | mailx -s "subject"
You can’t perform that action at this time.