Skip to content

Instantly share code, notes, and snippets.

View bryanthompson's full-sized avatar

Bryan Thompson bryanthompson

  • http://www.37chairs.com
  • Lincoln, NE
View GitHub Profile
@bryanthompson
bryanthompson / cache_helper.rb
Created January 14, 2010 22:08
Simple fragment caching in sinatra
require 'sinatra/base'
class CacheHelper
module Sinatra
module Helpers
def cache(name, options = {}, &block)
if cache = read_fragment(name, options)
@_out_buf << cache
else
pos = @_out_buf.length
To use with newsbeuter, drop this in your ~/.newsbeuter/config
bookmark-cmd "~/Documents/delicious-bookmark.rb"
Then when you find a story you want to bookmark, hit ctrl+b. Edit the URL and title if necessary.
If you want to add additional tags, put them before your description separated by spaces,
then include a |pipe| character. Example:
description:
toread madebymarket cms | This is the actual description I want to save.
@bryanthompson
bryanthompson / gist:2410717
Created April 18, 2012 02:36
Nagios Mailer using Amazon/SES and REE 1.8.7
[root@puppet nagios]# cat /bin/mailer
#!/opt/ruby-enterprise-1.8.7-2010.02/bin/ruby
require "rubygems"
require "choice"
require "amazon-ses-mailer"
PROGRAM_VERSION = 1
Choice.options do
@bryanthompson
bryanthompson / nginx.conf
Created August 8, 2012 20:33 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
require 'bundler/vlad'
set :application, "project-name"
set :domain, "server-name-in-ssh-config"
set :deploy_to, "/var/www/html/#{application}"
set :repository, "ssh://git@bitbucket.org/bryanthompson/#{application}.git"
namespace :vlad do
namespace :ec2 do
@bryanthompson
bryanthompson / gist:5273430
Created March 29, 2013 20:31
Firespring Tournament
Shuffleboard
http://www.ustream.tv/channel/firespring-final-four-finals
Foosball
http://www.ustream.tv/channel/firespring-final-four-21
Table Tennis
http://www.ustream.tv/channel/firespring-final-four-4
Pool

I've managed to program myself to not have strong preferences toward a lot of things, so as I rediscover things I strongly like I will put them on my list. Then when I forget what I like I can come back here and remember. Because while I can remember where lists and information live, I can't remember (mostly) useless stuff like what will live on this list.

Food

  • Ben & Jerry's Coffee Heath Bar Crunch
$ gem install devtunnel
$ devtunnel signup
# 1. Enter your email address
# 2. You'll get a confirmation email - click the link, paste your id_rsa.pub, set a password
$ devtunnel login
# log in with your email and password
<script type="text/javascript">
(function() {
var ads = document.getElementsByClassName("mbm_growlight"); var campaigns = [];
for (x=0;x<ads.length;x++) { campaigns[x] = ads[x].id; }
var gl = document.createElement('script'); gl.type = 'text/javascript'; gl.async = true;
gl.src = 'http://api.growlightnetwork.com/growlight.js/' + escape(campaigns.toString());
var s = document.getElementsByTagName("head")[0]; s.appendChild(gl);
})();
</script>

Keybase proof

I hereby claim:

  • I am bryanthompson on github.
  • I am bryanthompson (https://keybase.io/bryanthompson) on keybase.
  • I have a public key whose fingerprint is 6B25 6167 A47C 8F6A 6F5F 7150 C175 25F4 EFB3 9D69

To claim this, I am signing this object: