Skip to content

Instantly share code, notes, and snippets.

View brntbeer's full-sized avatar
:shipit:

Brent Beer brntbeer

:shipit:
View GitHub Profile
@brntbeer
brntbeer / think-it-through.md
Last active January 3, 2016 17:08
Why version Control? Built with <3 for Rails Girls (in SF)

Why even bother?

Learning to program can sometimes be a lot of pressure on a person. First you have to learn how to even program, how are these things structured? Next, you learn you should probably start learning about this cool text editor and all of its hand-contorting commands to really take your experience to the next level.

But then someone tells you "oh yeah, also take a look at Git and GitHub."

One thing at a time please, I'm new here.

I'd argue that learning about version control and it's importance should come before you try to be hip and cool with some

@brntbeer
brntbeer / git-update-fork.sh
Created June 17, 2013 22:04
Set up instructions to update your fork
# These instructions will set up a second remote server, fetch that data down to your
# remote tracking branches, namespaced under 'upstream/'.
# You can then checkout to your master, merge in the upstream changes, and push back to your fork (origin)
# where USER is the original owner name and ORIGINAL is the original project you forked from
git remote add upstream https://github.com/USER/ORIGINAL.git
git fetch upstream
git checkout master
git merge upstream/master
@brntbeer
brntbeer / plusplus.coffee
Created January 24, 2013 21:20
hubot score keeping
class ScoreKeeper
constructor: (@robot) ->
@cache = { scoreLog: {}, scores: {} }
@robot.brain.on 'loaded', =>
@robot.brain.data.scores ||= {}
@robot.brain.data.scoreLog ||= {}
@cache.scores = @robot.brain.data.scores || {}
@cache.scoreLog = @robot.brain.data.scoreLog || {}
@brntbeer
brntbeer / business_days.rb
Created October 8, 2012 23:38
Add to Fixnum a method to compute business days from today
#!/usr/bin/env ruby
class Fixnum < Integer
# Counts a given number of business days from today
def business_days_from_today
d = Date.today
day_count = 0
while(day_count <= self)
@brntbeer
brntbeer / opperators.lua
Created July 18, 2012 22:35
Lua operators
foo =
bar and baz and bar[baz]
or
var and var.this and var.this.that
or
nil
require 'rubygems'
require 'net/http'
require 'json'
uri = URI.parse("http://fluttrly.com/bouverdafs") #=> should be a valid task ID
http = Net::HTTP.new(uri.host, uri.port)
response = http.request(Net::HTTP::Get.new(uri.request_uri))
# Use the get response above to get an auth token and cookie

World famous FFFFFFFFUUUUUUUUU autotest-growl icon set

fucons

  1. download
  2. Edit your .autotest and add this line: Autotest::Growl::image_dir = File.expand_path("~")+'/Dropbox/Public/fu' (or wherever you unpacked fu.zip)
  3. ???????
  4. Profit!
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
State(const Formation f = Formation(),
const Vector grad = Vector(),
const vector<Relationship> r = vector<Relationship>(),
const Vector tError = Vector(),
const GLfloat rError = 0.0f,
const GLint ts = 0,
const GLint rID = -1,
const vector<NCellMsg> msgs = vector<NCellMsg>())
: formation(f), gradient(grad), rels(r),
transError(tError), rotError(rError), tStep(ts), refID(rID),