Skip to content

Instantly share code, notes, and snippets.


Mat Byczkowski mbyczkowski

Block or report user

Report or block mbyczkowski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mbyczkowski /
Last active Aug 29, 2015
Keep your git clean!
#!/usr/bin/env ruby
STDOUT.write("---+ Pruning origin... ")
`git remote prune origin`
STDOUT.write("---+ Collecting a list of merged branches to delete... ")
branch_output = `git branch -a --merged remotes/origin/master | grep -v master`
list_of_branches_to_delete = branch_output.split("\n")
# make sure we don't delete special branches, e.g. deploy branch
mbyczkowski / .codeclimate.yml
Created Jul 4, 2015
CodeClimate set-up for Node.js and Ruby project
View .codeclimate.yml
# CodeClimate supports multiple-language set-up on per-file basis
JavaScript: true
Ruby: true
mbyczkowski / .travis.yml
Created Jul 4, 2015
Travis CI config file for Node.js and Ruby in one repo
View .travis.yml
# As of writing this (7/4/2015) Travis CI only supports one language per project
# However, every box comes with Node.js and Ruby pre-installed.
# On top of it, you can install custom programs/libraries in the the `before_script` or 'before_install`
# stages.
# The easiest approach is to go with Node.js box and install approprtiate Ruby version
# or vice-versa
language: node_js
# pick your version of Node.js
- 0.12.2

Keybase proof

I hereby claim:

  • I am mbyczkowski on github.
  • I am matb ( on keybase.
  • I have a public key whose fingerprint is 1B88 DB20 5BFB 3A69 FFBA 16C1 CBAE 8AE6 119D 01E4

To claim this, I am signing this object:

View build Go from source
# create a new dir for each version of Go
git clone $HOME/go1.8
cd $HOME/go1.8
git checkout release-branch.go1.8
# assuming you installed go binary with homebrew
export GOROOT_BOOTSTRAP=/usr/local/opt/go/libexec
mbyczkowski / decrypt_rails_session.lua
Created Mar 10, 2017
session cookie decrypter for Rails 4.2+ (in OpenResty Lua)
View decrypt_rails_session.lua
local aes = require("resty.aes")
local str = require("resty.string")
local sha1 = require("bgcrypto.sha1")
local cjson = require("cjson")
function verify_and_decrypt_session_cookie(cookie, secret_key_base)
local rounds = 1000
local secret_length = 32
local sign_secret_length = 64
local cookie = ngx.unescape_uri(cookie)
mbyczkowski /
Last active Aug 20, 2018
Dnsmasq config for OS X
#!/usr/bin/env bash
# Resolve dev domains locally and passthrough other DNS requests
set -e
dnsmasq_installed=`brew list | grep dnsmasq`
if [ -n "$dnsmasq_installed"]; then
echo "Installing Dnsmasq..."
brew install dnsmasq
View try new Go version
# Assuming you already have Go installed
# Works with any released version of Go (including beta builds)
# Prior to Go 1.11 `go get<GO_VERSION>` was used.
go get
# Assuming that $GOBIN is added to your $PATH
go1.11 download
mbyczkowski / with_active_support.rb
Last active Mar 31, 2020 — forked from tonytonyjan/rails_42_with_active_support.rb
session cookie decrypter for Rails 4.2+
View with_active_support.rb
require 'cgi'
require 'json'
require 'active_support'
def verify_and_decrypt_session_cookie(cookie, secret_key_base)
cookie = CGI::unescape(cookie)
salt = 'encrypted cookie'
signed_salt = 'signed encrypted cookie'
key_generator =, iterations: 1000)
secret = key_generator.generate_key(salt)[0, ActiveSupport::MessageEncryptor.key_len]
You can’t perform that action at this time.