Skip to content

Instantly share code, notes, and snippets.

View dkubb's full-sized avatar
🏠
Working from home

Dan Kubb dkubb

🏠
Working from home
  • Betterment
  • Mission, BC, Canada
  • X @dkubb
View GitHub Profile
@noteed
noteed / minimal-docker-haskell.md
Last active August 20, 2022 01:20
Notes about creating small Docker images with Haskell binaries.
@josephglanville
josephglanville / ruby_image.sh
Created October 21, 2014 11:26
Create bare Ruby docker image
#!/bin/bash
TARGET=$1
mkdir -p $TARGET
files=$(
dpkg -L ruby | grep '/usr/bin/'
dpkg -L ruby1.9.1 | grep '/usr/bin/'
echo '/usr/lib/ruby'
)
@millermedeiros
millermedeiros / osx_setup.md
Last active June 26, 2024 22:08
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@dkubb
dkubb / git-remove-merged.sh
Last active March 8, 2023 17:24 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
git remote update &&
git remote prune origin &&
git branch -r --merged origin/master |
awk -F"/" '!/(>|master)/ {print $2}' |
xargs -rL1 git push origin --delete
@dkubb
dkubb / explanation.md
Created October 24, 2011 02:32
Veritas Explanation

https://github.com/dkubb/veritas

High level design

  • In Veritas a relation is an Enumerable object that will yield a set of tuples.
  • Internally a relation is represented as a tree.
  • The leaf nodes are base relations, which are the data sources.
  • There are 3 types of inner nodes:
    1. A node may be a relational algebra operation like join, rename, project or others. When iterated it will evaluate it's children, then perform the operation in-memory and yield each tuple
ast = "def foo(a) p a end; foo(1)".to_ast
root = Rubinius::AST::Script.new ast
root.file = "(heckle)"
compiler = Rubinius::Compiler.new :bytecode, :compiled_method
compiler.generator.input root
cm = compiler.run
script = cm.create_script
Rubinius.run_script script.compiled_method
@nstielau
nstielau / default.rb
Created May 18, 2011 16:22
A simple Chef recipe to install Jenkins
#
# Cookbook Name:: jenkins
# Recipe:: default
#
# https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
# This is super-simple, compared to the other Chef cookbook I found
# for Jenkins (https://github.com/fnichol/chef-jenkins).
#
# This doesn't include Chef libraries for adding Jenkin's jobs via
@myw
myw / delete_merged_remotes.sh
Created April 26, 2011 20:02 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
#!/bin/sh
git branch -r --merged | \
awk -F/ '!/>|master/&&/origin/{print $2}' | \
xargs git push origin --delete
@dkubb
dkubb / email_on_log_write.sh
Created November 19, 2010 15:55
Sends an email to an address when a log is written to
tail -0f test.log | ruby -ne 'open("|mailx -s Log dan.kubb@gmail.com", "w", &:print)'
require File.dirname(__FILE__) + '/spec_helper'
describe "The library itself" do
Spec::Matchers.define :have_no_tab_characters do
match do |filename|
@failing_lines = []
File.readlines(filename).each_with_index do |line,number|
@failing_lines << number + 1 if line =~ /\t/
end
@failing_lines.empty?