Skip to content

Instantly share code, notes, and snippets.

View selenamarie's full-sized avatar

Selena Deckelmann selenamarie

View GitHub Profile
@rhelmer
rhelmer / gist:b075f21f44f3e98579b1
Last active November 1, 2022 12:13
herokuish build+deploy using LXC

Introduction

Heroku differs from traditional build & deploy by having the concept of "buildpacks", which are a generic method to identify, compile and package builds. The traditional method here would be to have hardcoded build commands, in a Makefile for instance. Buildpacks generally make custom build+deploy steps uneccessary, although one can specify custom buildpacks if necessary.

When notifying Heroku that a deploy is needed (usually by a Github webook), Heroku will run through all supported buildpacks until one can identify your app, which is then compiled and packaged by the buildpack. The output of this process is referred to as a "slug", which contains your app and all dependencies. For instance, a Python app would have the virtualenv packaged inside it. Heroku automatically deploys slugs that are built successfully.

This document describes a way to use LXC and existing third-party tools to reproduce this setup.

You need to have a server running that accepts webhooks and can take act

@rhelmer
rhelmer / gist:1475ac173362edefa469
Last active November 24, 2016 10:16
Socorro Lite

Socorro (Lite)

  1. Create a place to hold crashes
mkdir crashreports
cd crashreports
  1. Build stackwalker
@twobraids
twobraids / gist:789e66fbe7590947b1dd
Created December 27, 2014 16:36
a limerick about reading code
I once saw some really opaque code;
while thinking this is just a big load;
ought to write it again;
to do less is a sin;
"choose writing over reading", I crowed
@emilyst
emilyst / gif.py
Last active December 29, 2015 14:19
#!/usr/local/bin/python3
# save to: ~/Library/Application\ Scripts/com.codeux.irc.textual/gif.py
# use as '/gif searchterm'
# prints a link to the first GIF to match the term to the current window
import sys
import random
search_term = sys.argv[2]
@kyledrake
kyledrake / gist:5915757
Last active December 19, 2015 06:59
Using Ruby to fuck up a file system
```ruby
require 'fileutils'
require 'securerandom'
2_000_000.times do |site|
site_name = SecureRandom.hex[0...20]
puts site_name
Dir.mkdir File.join('./', 'sites', site_name)
@JerrySievert
JerrySievert / gist:5686043
Created May 31, 2013 16:08
geojson to esri json
work=# select geoJSONToEsri('{ "type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
]
}', '{ "wkid": 4326 }');
geojsontoesri
--------------------------------------------------------------------------------
--------
{"rings":[[[100,0],[101,0],[101,1],[100,1],[100,0]]],"spatialReference":{"wkid"
@JerrySievert
JerrySievert / gist:5686037
Created May 31, 2013 16:06
esri json to geojson
work=# select esriToGeoJSON('{"rings":[[[100,0],[101,0],[101,1],[100,1],[100,0]]],"spatialReference":{"wkid":4326}}');
esritogeojson
------------------------------------------------------------------------------
{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]}
@blkperl
blkperl / gist:5101611
Last active December 14, 2015 14:38
Parallel pg_dump Patch Testing
@wilkie
wilkie / experiment.rb
Created November 19, 2012 23:51
Code to produce a probability distribution of how likely a gender breakdown in conference speakers is, and also to experiment to produce the result
# This program will select at random a set of speakers and look at the gender breakdown given 20% women
total_speakers = 15
percentage_of_women = 0.25
hist, list, results = {}, [], []
(1000 * (1 - percentage_of_women)).floor.times{list << 0}
(1000 * percentage_of_women).floor.times{list << 1}
@max-mapper
max-mapper / index.js
Created August 20, 2012 06:29
official semicolon style of @maxogden
function toCSV = function(table, cb) {
;;;;var cmd = spawn('mdb-export', [this.file, table])
;;;;cmd.stdout.pipe(concat(function(err, out) {
;;;;;;;;;;;;if (err) return cb(err)
;;;;;;;;;;;;if (!out) return cb('no output')
;;;;;;;;;;;;cb(false, out.toString())
;;;;;;;;}))
}