Skip to content

Instantly share code, notes, and snippets.

View toddboom's full-sized avatar

Todd Persen toddboom

View GitHub Profile
@toddboom
toddboom / gist:8943459
Created February 11, 2014 20:31
influxdb-rails
# install the gem
gem "influxdb-rails"
# generate the initializer
rails generate influxdb
# what the initializer looks like
InfluxDB::Rails.configure do |config|
config.influxdb_database = "rails"
config.influxdb_username = "root"
@toddboom
toddboom / gist:7342965
Created November 6, 2013 19:49
Building go v1.1.2 on Mavericks via Homebrew
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
==> Downloading https://go.googlecode.com/files/go1.1.2.src.tar.gz
Already downloaded: /Library/Caches/Homebrew/go-1.1.2.tar.gz
tar xf /Library/Caches/Homebrew/go-1.1.2.tar.gz
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
patching file src/cmd/ld/lib.c
Hunk #1 succeeded at 665 with fuzz 2.
==> ./make.bash --no-clean
# Building C bootstrap tool.
@toddboom
toddboom / ember.html
Created August 23, 2013 17:30 — forked from trek/ember.html
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{input type="text" value=searchText placeholder="Search..."}}
<ul>
{{#each searchResults}}
<li>{{this}}</li>
{{/each}}
</ul>
</script>
autocompleteApp = angular.module "autocompleteApp", []
autocompleteApp.controller "AutocompleteCtrl", ["$scope", ($scope) ->
$scope.results = ["one", "two", "three"]
]
App = Ember.Application.create()
App.AutocompleteController = Ember.Controller.extend(
searchText: null
searchResults: ->
searchText = @get("searchText")
return unless searchText
regex = new RegExp(searchText, "i")
["one", "two", "three"].filter (name) ->
name.match regex
<div class="pagination">
<span class="disabled prev_page">&laquo; Previous</span>
<span class="current">1</span>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=2" rel="next">2</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=3">3</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=4">4</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=5">5</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=6">6</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=7">7</a>
<a href="/homebase/browse/all-metro/all-neighborhoods/modern?page=8">8</a>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<!-- Get crunk. Save the world. -->
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<meta content='index, follow' name='robots' />
<meta content='index, follow' name='googlebot' />
<meta content='no' http-equiv='imagetoolbar' />
<meta content='false' http-equiv='imagetoolbar' />
<title>Leah D'Emilio (leahdemilio) / Magma</title>
@channel = Channel.find(643)
@channel.videos.each {|v| v.instance.embed = v.instance.embed.gsub('&amp; ', '&amp;').gsub('1847329225','1847322191').gsub('playlistTabs', 'videoPlayer'); v.instance.save }
export LC_CTYPE=en_US.UTF-8
export TERM=screen
export PATH=/opt/ruby/bin:/var/lib/gems/1.8/bin:$PATH
export EDITOR=vi
export RAILS_ENV="production"
export MERB_ENV="production"
alias chives='cd ~/chives; python chives2.py >chives.log 2>&1 & tail -f chives.log'
vbell on
defscrollback 1024
escape ``
startup_message off
# default screens
screen -t w0 0 bash
screen -t w1 1 bash
screen -t w2 2 bash