Skip to content

Instantly share code, notes, and snippets.

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

Patrick Costa patrickrbc

🏠
Working from home
View GitHub Profile
#!/bin/bash
# Warn before pushing to protected branches
# Make script executable with chmod +x pre-push
# Bypass with git push --no-verify
BRANCH=`git rev-parse --abbrev-ref HEAD`
PROTECTED_BRANCHES="^(master)"
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]]; then
read -p "Are you sure you want to push to \"$BRANCH\" ? (y/n): " -n 1 -r < /dev/tty

Keybase proof

I hereby claim:

  • I am patrickrbc on github.
  • I am patrickrbc (https://keybase.io/patrickrbc) on keybase.
  • I have a public key ASD95f1f3Lba6bDQwFs4pzt1RdXQO48cJe_SVKhyv82nWgo

To claim this, I am signing this object:

thisisjustatest
@patrickrbc
patrickrbc / coldfusion_password.py
Created June 14, 2018 18:18
Script to decrypt coldfusion database passwords
#!/usr/bin/python
#
# Coldfusion Password Tool
# Copyright (C) 2013 Adam Boeglin <adamrb@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
;(function (root) {
'use strict';
function PubSub () {
this.topics = {};
}
PubSub.prototype.subscribe = function (name, fn) {
this.topics[name] = this.topics[name] || [];
this.topics[name].push(fn);
var noop = function(){ };
function map(list, func, callback) {
var result = new Array(list.length);
var count = 0;
list.forEach(iterator);
function iterator (item, index) {
func(item, executed);