Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Backtrace
  • Dallas, TX
View GitHub Profile
# Start working on a pull request, this requires a .git/user-repo file
# containing the string "user/repository"
pr() {
local pr_num=$1
if [[ -z $pr_num ]]; then
echo "Need the pull request number" >&2
return 1
fi
if [[ ! -r .git/user-repo ]]; then
echo "Need to setup user/repo" >&2
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
build_package_reconfigure() {
test -f configure || autoconf
}
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
patch -p1 < rvm-patchsets/patches/ruby/2.1.1/railsexpress/01-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.1/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.1/railsexpress/03-display-more-detailed-stack-trace.patch
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@cstrahan
cstrahan / tailor.sh
Last active August 29, 2015 14:22 — forked from sinelaw/tailor.sh
#!/bin/bash -eu
LOG_FILE=$1
SB="stdbuf -i0 -oL"
shift
tput sc
$@ 2>&1 | $SB tee $LOG_FILE | $SB cut -c-$(tput cols) | $SB sed -u 's/\(.\)/\\\1/g' | $SB xargs -0 -d'\n' -iyosi -n1 bash -c 'tput rc;tput el; printf "\r%s" yosi'
EXIT_CODE=${PIPESTATUS[0]}
tput rc;tput el;printf "\r" # Delete the last printed line
exit $EXIT_CODE
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
import Control.Lens
import Data.Maybe
import Data.Monoid
data Constant a b =
Constant a
--- a/w3mimg/x11/x11_w3mimg.c 2004-11-08 12:14:06.000000000 -0500
+++ b/w3mimg/x11/x11_w3mimg.c 2015-03-12 23:23:44.964555734 -0400
@@ -214,9 +214,12 @@
Pixmap p;
GC gc;
XImage *i;
+ XWindowAttributes attr;
+
+ XGetWindowAttributes(xi->display, xi->window, &attr);
@cstrahan
cstrahan / SslClientAuth.hs
Created November 25, 2015 23:29 — forked from superduper/SslClientAuth.hs
Example how to use wreq with ssl
{-# LANGUAGE OverloadedStrings #-}
module Network.HttpSSL (
postSSL
, SSLOptions (..)
) where
{-
build-depends:
wreq
, HsOpenSSL
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}