Skip to content

Instantly share code, notes, and snippets.

Avatar
🚪

Tim Dorr timdorr

🚪
View GitHub Profile
@timdorr
timdorr / deploy.rake
Created Jun 19, 2014
Rollbar Deploy Rake Task
View deploy.rake
namespace :deploy do
desc "Tell Rollbar about the deploy"
task :rollbar => :environment do
git_revision = `git log -n 1 --pretty=format:"%H"`
git_user = `git log -1 --pretty=%an`
git_message = `git log -1 --pretty=%B`
res = HTTParty.post("https://api.rollbar.com/api/1/deploy/", body: {
access_token: Rollbar.configuration.access_token,
environment: "production",
View keybase.md

Keybase proof

I hereby claim:

  • I am timdorr on github.
  • I am timdorr (https://keybase.io/timdorr) on keybase.
  • I have a public key whose fingerprint is 96B2 2FEB 89BC BA32 C41B 6161 990C 41F1 D712 B089

To claim this, I am signing this object:

@timdorr
timdorr / railsconf_schedule.rb
Last active Aug 29, 2015 — forked from sionide21/railsconf_schedule.rb
Make the Schedule Items at http://railsconf.com/schedule clickable to add to your Google Calendar
View railsconf_schedule.rb
var authuser = 2; // Change if you have multiple Google accounts logged in. This is zero-indexed.
$("<script/>", {type: "text/javascript", src: "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"}).appendTo(document.body);
$(".session-content a").on("click", function() { event.stopPropagation(); });
$(".session-content").on("click", function() {
var session = $(this),
title = session.find(".session-title"),
details = title.find("a")[0].href,
speaker = session.find(".speaker-name"),
View sitandspin.css
*:hover {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
@timdorr
timdorr / tesla_stream_reader.rb
Created Nov 14, 2013
Stream data from Tesla's API to TempoDB
View tesla_stream_reader.rb
class TeslaStreamReader
def initialize(email, password)
@tesla_api = TeslaApi.new(email, password)
end
def stream_to_tempodb
loop do
@tesla_api.vehicles.first.wake_up
car = @tesla_api.vehicles.first
@timdorr
timdorr / routes.js
Created Jan 27, 2016
Some common routes (taken from the react-router examples)
View routes.js
import { Route } from 'react-router'
import App from 'components/App'
import Page1 from 'components/Page1'
import Page2 from 'components/Page2'
import Tab1 from 'components/Tab1'
import Tab2 from 'components/Tab2'
export default const routes = (
<Route path="/" component={App}>
@timdorr
timdorr / app.js
Created Jan 27, 2016
A possible reroute component
View app.js
import { Component } from 'reroute';
export default class App extends Component {
render() {
return (
<div>{this.props.params.id}</div>
)
}
}
@timdorr
timdorr / reroutes.js
Last active Jan 27, 2016
An idea for a new kind of router in React.
View reroutes.js
import App from 'components/App'
import Page1 from 'components/Page1'
import Page2 from 'components/Page2'
import Tab1 from 'components/Tab1'
import Tab2 from 'components/Tab2'
export default const routes = (
<App path="/">
<Page1 path="page1">
<Tab1 path="tab1" />
View autoload.routes.js
export default const routes = (
<App path="/">
<Page1 path="page1">
<Tab1 path="tab1" />
<Tab2 path="tab2" />
</Page1>
<Page2 path="page2">
<Tab1 path="tab1" />
<Tab2 path="tab2" />
</Page2>
@timdorr
timdorr / .gitconfig
Created Jan 26, 2016
.gitconfig aliases
View .gitconfig
[alias]
st = status -sb
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
up = !git fetch origin && git rebase origin/master
mup = !git fetch origin && git merge origin/master
done = "!git checkout master && git pull && git fetch -p && git branch --merged | grep -Pv '\\*|master' | xargs -n 1 git branch -d"