Skip to content

Instantly share code, notes, and snippets.

👨‍🚀
...

Toby Hede tobyhede

👨‍🚀
...
Block or report user

Report or block tobyhede

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View adr.md

Title

Short present tense imperative phrase, less than 50 characters, like a git commit message.

Status

proposed, accepted, rejected, deprecated, superseded, etc.

Context

What is the issue that we're seeing that is motivating this decision or change.

View keybase.md

Keybase proof

I hereby claim:

  • I am tobyhede on github.
  • I am tobyhede (https://keybase.io/tobyhede) on keybase.
  • I have a public key whose fingerprint is 9AA8 2B2E D31F EC90 2F24 7373 0678 0493 F70A EDB6

To claim this, I am signing this object:

@tobyhede
tobyhede / generate_tseries.sql
Created Jun 25, 2016
Easily generate timeseries data in PostgreSQL
View generate_tseries.sql
CREATE TABLE tseries AS
SELECT ts, (random()*9999)::int as count from generate_series(
'2015-01-01'::timestamptz,
'2016-06-01'::timestamptz,
'1 sec'::interval
) date;
@tobyhede
tobyhede / Dockerfile
Created Nov 20, 2015
Elixir Phoenix Dockerfile
View Dockerfile
FROM ubuntu:14.04.3
MAINTAINER Toby Hede <>
ENV ELIXIR_VERSION 1.1.1
ENV PORT 80
ENV MIX_ENV prod
# Elixir requires UTF-8
RUN locale-gen en_US.UTF-8
View vsjsonp.js
// VSJONP ― Very Simple JSONP
// ==========================
//
// Usage:
// fetchJsonP({
// url: 'http://shit-no-cors.json',
// complete: function(response) {
// console.log(response);
// }
// });
View uninstall_gems.sh
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
View martini.go
package main
import (
// "fmt"
"log"
"net/http"
"runtime"
"github.com/go-martini/martini"
"github.com/jmoiron/sqlx"
"github.com/martini-contrib/render"
View react.js
<script type="text/jsx">
/** @jsx React.DOM */
var AppList = React.createClass({
render: function() {
var elements = this.state.apps.map(function(app) {
return <AppElement app={app} />
})
return <ul>{elements}</ul>;
View weber.md
defmodule Route do

  import Weber.Route
  require Weber.Route

  route on("GET", "/new", :WeberTest.Main, :blah)
    |>  on("GET", "/", :WeberTest.Main, :index)

end
@tobyhede
tobyhede / tap.rb
Last active Jan 2, 2016
To tap or not to tap ...
View tap.rb
#assuming a method returning an account
Account.where(email: email).first_or_create.tap do |account|
account.update_attributes!(name: name, login: login, image: image)
end
account = Account.where(email: email).first_or_create
account.update_attributes!(name: name, login: login, image: image)
account
You can’t perform that action at this time.