Skip to content

Instantly share code, notes, and snippets.

Avatar
🙅‍♀️
permanent omnishambles

Robin Howard damncabbage

🙅‍♀️
permanent omnishambles
View GitHub Profile
View README.md

Setup

Add the following gems to your Gemfile:

gem 'activeresource'
gem 'newrelic_api'

Update your bundle:

anonymous
anonymous / Haskell
Created Oct 7, 2013
Comparison of the straightforward embedding of a basic tenet of category theory in Scala vs Haskell.
View Haskell
yonedaLemma = Iso (flip fmap) ($ id)
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active Oct 13, 2021
Opening and closing an SSH tunnel in a shell script the smart way
View opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost
@jbenet
jbenet / simple-git-branching-model.md
Last active Oct 6, 2021
a simple git branching model
View simple-git-branching-model.md

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

View gist:6409580
# Kool console
# ============
#
# A snippet for running CoffeeScript snippets in browser, with a cool
# centered text input.
#
# Press <meta> + K to open the console.
# Styles for the text field.
CSS = """
@holman
holman / Guthrie IP.md
Last active Aug 4, 2016
Woody Guthrie, on intellectual property.
View Guthrie IP.md

This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.

View coollanguagebro.py
def f(x = []):
x.append(1)
return x
print f() # [1]
print f() # [1, 1]
print f() # [1, 1, 1]
print f() # [1, 1, 1, 1]
@drogus
drogus / Rakefile.rb
Created Jul 26, 2013
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
View Rakefile.rb
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'
View gist:6077238
{-# LANGUAGE OverloadedStrings #-}
import qualified Network.HTTP.Conduit as H
import Control.Exception
import Web.Scotty
import System.Environment
import System.IO
import System.Directory
import Control.Monad
import Control.Monad.IO.Class
import qualified Data.ByteString.Lazy.Char8 as BS
@aussiegeek
aussiegeek / tramtracker.rb
Created Jul 25, 2013
Job to get tram data for dashing
View tramtracker.rb
require "rexml/document"
SCHEDULER.every '1m', :first_in => 0 do |job|
stop_no = 1819
url = URI.parse('http://ws.tramtracker.com.au/pidsservice/pids.asmx')
request =Net::HTTP::Post.new(url.path)
request.body = %Q{<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<PidsClientHeader xmlns="http://www.yarratrams.com.au/pidsservice/">