Skip to content

Instantly share code, notes, and snippets.

View gordlea's full-sized avatar

Gord Lea gordlea

View GitHub Profile
@gordlea
gordlea / gist:7222b0f702a625fd40ff
Last active October 30, 2015 18:14 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
# OR
git branch -m new_branch # Rename current branch
# THEN
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@gordlea
gordlea / good ppas
Last active December 28, 2015 06:59
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mirror.weathercity.com/mariadb/repo/5.5/ubuntu precise main'
@gordlea
gordlea / scope.conf
Last active January 6, 2016 17:46
weave autolaunch on trusty
# scope - start weave after weave
# place under /etc/init/scope.conf
description "starts weave.scope"
author "Gord Lea <jgordonlea@gmail.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas
@gordlea
gordlea / .eslintrc.json
Last active June 23, 2016 19:16
js project boilerplate
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
@gordlea
gordlea / html-domparser.js
Created July 5, 2016 19:51 — forked from eligrey/html-domparser.js
DOMParser HTML extension - Now a polyfill since HTML parsing was added to the DOMParser specification
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */

Keybase proof

I hereby claim:

  • I am gordlea on github.
  • I am gordtron (https://keybase.io/gordtron) on keybase.
  • I have a public key ASANvou6M__LnUn4ySBZShNczzSatlcJnkDfwlTSoGkbkQo

To claim this, I am signing this object:

@gordlea
gordlea / hipchat-v1.sh
Created August 1, 2018 14:57 — forked from rquadling/hipchat-v1.sh
Send an HTML message to HipChat using v1 of the api via cURL
MESSAGE="
<table><thead><tr><td colspan=\"2\"><b>Build starting</b></td></tr></thead>
<tbody>
<tr><td><b>Tag</b></td><td>${build_tag}</td></tr>
<tr><td><b>Built for</b></td><td>${built_for}</td></tr>
<tr><td><b>Built by</b></td><td>${built_by}</td></tr>
</tbody>
</table>
"
curl -s -X POST \
@gordlea
gordlea / snapshot-lxc.containers.sh
Last active May 23, 2019 15:31
Update/snapshot all lxc containers (debian, ubuntu, fedora, centos and alpine supported)
#!/usr/bin/env bash
snapshot_containers () {
running_containers=()
while IFS= read -r line; do
running_containers+=( "$line" )
done < <( lxc list --columns=ns --format=json \
| jq --raw-output 'map(select(.status | contains("Running")) | .name) | .[]' )
for i in "${running_containers[@]}"; do
echo "taking snapshot of apt based container: $i"
@gordlea
gordlea / jenkins-publish.sh
Last active September 9, 2019 18:49
Jenkins NPM Publish
#!/bin/sh
echo `env`
echo `ls`
git fetch --tags
git checkout master
git pull origin master
git branch release-$PROMOTED_GIT_COMMIT $PROMOTED_GIT_COMMIT
git clean -f
case $INCREMENT_VERSION in
@gordlea
gordlea / del_node_modules.sh
Created December 12, 2016 17:06
delete node_modules recursively
#!/bin/bash
# taken from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
find . -name "node_modules" -exec rm -rf '{}' +