Skip to content

Instantly share code, notes, and snippets.

View hbarrington's full-sized avatar
💭
Exploring a new side-project (let's do some scraping!)

Hunter Barrington hbarrington

💭
Exploring a new side-project (let's do some scraping!)
  • Bestgate Engineering
  • Baltimore, MD / Washington DC
View GitHub Profile
@hbarrington
hbarrington / awesome-nginx.conf
Created December 29, 2016 14:53 — forked from vjt/awesome-nginx.conf
*AWESOME* nginx configuration for Ruby/Rack web applications
#
# mmm m m mmm mmm mmm mmmmm mmm
# " # "m m m" #" # # " #" "# # # # #" #
# m"""# #m#m# #"""" """m # # # # # #""""
# "mm"# # # "#mm" "mmm" "#m#" # # # "#mm"
#
# nginx configuration For Ruby/Rack web applications
#
# Cooked up with style, care and a bit of *secret*
# nerdy spice. :-)

Keybase proof

I hereby claim:

  • I am hbarrington on github.
  • I am hbarrington (https://keybase.io/hbarrington) on keybase.
  • I have a public key whose fingerprint is 27AA 1FCF 36E6 55F8 4648 E555 7889 3D56 3287 C6C7

To claim this, I am signing this object:

Hunters-MacBook-Air:ea2 hunter$ mdb-ver ./db/PAIS.mdb
JET4
Hunters-MacBook-Air:ea2 hunter$ mdb-schema ./db/PAIS.mdb
-- ----------------------------------------------------------
-- MDB Tools - A library for reading MS Access database files
-- Copyright (C) 2000-2011 Brian Bruns and others.
-- Files in libmdb are licensed under LGPL and the utilities under
-- the GPL, see COPYING.LIB and COPYING files respectively.
-- Check out http://mdbtools.sourceforge.net
-- ----------------------------------------------------------
@hbarrington
hbarrington / harvest.py
Last active December 23, 2015 07:09
Learning Registry Harvest example
#based on documentation from https://github.com/LearningRegistry/LearningRegistry/wiki/Consuming-Learning-Registry-Records
import urllib2
import urllib
import json
import urlparse
from pprint import pprint
def harvest(start_url):
#start by adding the root URL to the list of urls to harvest from
class AppBuilder < Rails::AppBuilder
include Thor::Actions
include Thor::Shell
def test
append_test_gems
rspec
cucumber
end
require 'benchmark'
5.times do |i|
i = 10 ** i
h = Hash[i.times.map { |z| [z, z] }]
puts "N KEYS: #{i}"
puts
Benchmark.bm do |x|
x.report('dup') { 1000.times { h.dup } }
@hbarrington
hbarrington / app.rake
Created July 9, 2012 17:35 — forked from ChuckJHardy/app.rake
Rake Task for Database Population
------------ From Rake Task
namespace :app do
# Checks and ensures task is not run in production.
task :ensure_development_environment => :environment do
if Rails.env.production?
raise "\nI'm sorry, I can't do that.\n(You're asking me to drop your production database.)"
end
end
@hbarrington
hbarrington / adsense_helper.rb
Created June 12, 2012 19:43 — forked from defkode/adsense_helper.rb
Google Adsense Rails 3 helper
module AdsenseHelper
# Author: Tomasz Mazur (defkode@gmail.com)
# http://www.mydigitallife.info/2009/01/17/google-adsense-legacy-old-generation-code-reference-generate-and-get/
# :slot
# :theme
# :background
# :border
# :link
# :text