Skip to content

Instantly share code, notes, and snippets.

Working from home

Daniel Huckstep darkhelmet

Working from home
View GitHub Profile
darkhelmet / pre-commit
Created Mar 21, 2019
Never commit ruby syntax errors
View pre-commit
#!/usr/bin/env bash
set -e
files() {
git diff --name-only --cached --full-index
check() {
while read file; do
filename=$(basename "$file")
View application_restriction.rb
class ApplicationRestriction
include Virtus.model(strict: true)
def to_module(&block)
restriction = self
mod = do
define_singleton_method(:inspect) do
darkhelmet /
Last active May 23, 2018 — forked from minrk/
bootstrap single node kubernetes with minikube (no vm)
set -x
# apt -y update
# apt -y dist-upgrade
# apt -y install
which minikube || (curl -Lo minikube && chmod +x minikube && mv minikube /usr/local/bin/)
which kubectl || (curl -Lo kubectl$(curl -s && chmod +x kubectl && mv kubectl /usr/local/bin/)
which helm || (curl -Lo helm.tar.gz && tar -xzf helm.tar.gz && mv linux-amd64/helm /usr/local/bin/)
View Random Goodies
4 Azor, the Lawbringer
4 Back to Nature
1 Cruel Tutor
1 Deranged Hermit
1 Devoted Druid
3 Dire Fleet Daredevil
4 Dire Fleet Poisoner
1 Hypnotic Specter
1 Reflecting Pool
1 Stormbreath Dragon
# Assignment:
number = 42
opposite = true
# Conditions:
number = -42 if opposite
# Functions:
square = (x) -> x * x
View gist:1de2b726e87be1a7a671
<style type="text/css">
#watermark {
color: #d0d0d0;
font-size: 200pt;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
position: absolute;
width: 100%;
View active_admin.rb
# if you want to monkey patch every controller, put this in initializers/active_admin.rb
ActiveAdmin::ResourceController.class_eval do
include ActiveAdmin::CSVStream
View gist:11390354
~/dev/go/src/ (master?) » go test -i
can't load package: package cannot find package "" in any of:
/Users/darkhelmet/local/go/src/pkg/ (from $GOROOT)
/Users/darkhelmet/dev/go/src/ (from $GOPATH)
darkhelmet / gist:9987548
Last active Aug 29, 2015
Uploading a specific pair of files to rails 4.0.4/rbx 2.2.6/nginx 1.5.12/passenger enterprise 4.0.40 fails
View gist:9987548
App 11159 stderr: [ 2014-04-04 22:31:47.7216 11313/0x2320c(Worker 4) utils.rb:52 ]: *** Exception NoMethodError in Rack application object (undefined method `-' on nil:NilClass.) (process 11313, thread 0x2320c(Worker 4)):
App 11159 stderr: from kernel/delta/kernel.rb:78:in `- (method_missing)'
App 11159 stderr: from kernel/common/string.rb:1997:in `[]='
App 11159 stderr: from kernel/common/string.rb:1332:in `slice!'
App 11159 stderr: from /home/deploy/cogs/shared/bundle/rbx/2.1/gems/rack-1.5.2/lib/rack/multipart/parser.rb:113:in `get_current_head_and_filename_and_content_type_and_name_and_body'
App 11159 stderr: from /home/deploy/cogs/shared/bundle/rbx/2.1/gems/rack-1.5.2/lib/rack/multipart/parser.rb:19:in `parse'
App 11159 stderr: from kernel/common/kernel.rb:460:in `loop'
App 11159 stderr: from /home/deploy/cogs/shared/bundle/rbx/2.1/gems/rack-1.5.2/lib/rack/multipart/parser.rb:17:in `parse'
App 11159 stderr: from /home/deploy/cogs/shared/bundle/rbx/2.1/gems/rack-1.5.2/lib/rack/multipart.rb:25:in `p
darkhelmet /
Created Mar 4, 2014 — forked from dysinger/
Using docker to build deb of ruby so you don't need to use rvm or something on the server
cat > Dockerfile <<\EOF
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y ruby1.9.3 build-essential \
libc6-dev libffi-dev libgdbm-dev libncurses5-dev \
libreadline-dev libssl-dev libyaml-dev zlib1g-dev
RUN gem install fpm --bindir=/usr/bin --no-rdoc --no-ri
RUN apt-get install -y curl
RUN curl|tar oxzC /tmp
WORKDIR /tmp/ruby-1.9.3-p484