Skip to content

Instantly share code, notes, and snippets.

@jaxzin
jaxzin / WS2032_Grafana.puml
Created November 27, 2022 04:38
A UML component diagram of my WS2032 Weather Station setup.
@startuml
!theme materia-outline
skinparam backgroundColor white
skinparam defaultFontName Futura
skinparam defaultFontSize 16
left to right direction
node "WS2032 Weather Station"
actor "Web User"
@jaxzin
jaxzin / rateplot.bash
Created June 18, 2015 02:32
Watching a long running git svn fetch...
# Watch the .git dir and log any file size changes
delay=1; prev=`du -sk .git/ | cut -f 1`; sleep $delay; while true; do cur=`du -sk .git/ | cut -f 1`; expr \( $cur - $prev \) / $delay ; prev=$cur; sleep $delay; done > rate.log &
# Chart the .git dir's file size changes (estimate of activity)
watch -n 1 'gnuplot -e "set terminal dumb;p \"<tail -25 rate.log\" with lines notitle"'
@jaxzin
jaxzin / snap-ci.sh
Last active August 29, 2015 14:13
Snap-CI pipeline config for autodeploying danbury.io pull requests
# Deploy Stage
sudo yum install --assumeyes jq
heroku apps:destroy \
--app danburyio-pr$SNAP_PULL_REQUEST_NUMBER \
--confirm danburyio-pr$SNAP_PULL_REQUEST_NUMBER || true
heroku create danburyio-pr$SNAP_PULL_REQUEST_NUMBER \
--buildpack https://github.com/heroku/heroku-buildpack-nodejs.git
heroku addons:add mongolab:sandbox
heroku domains:add $SNAP_PULL_REQUEST_NUMBER.pr.danbury.io
curl -H "X-DNSimple-Token: $DNSIMPLE_USER:$DNSIMPLE_TOKEN" \
@jaxzin
jaxzin / keybase.md
Created April 7, 2014 14:15
keybase.md

Keybase proof

I hereby claim:

  • I am jaxzin on github.
  • I am jaxzin (https://keybase.io/jaxzin) on keybase.
  • I have a public key whose fingerprint is 2CDD E247 9125 9D15 4E83 BB28 E2B6 8177 3FD7 E15D

To claim this, I am signing this object:

@jaxzin
jaxzin / gist:8393988
Created January 13, 2014 02:51
Cucumber-JVM, hacking Scenario object to get the scenario name.
@Before
public void initSelenium(Scenario scenario) throws Exception {
// TODO: Find the scenario name
String scenarioName = ((ExecutionUnitRunner)getPrivateField(getPrivateField(scenario, "reporter"), "executionUnitRunner")).getName();
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("version", "5");
capabilities.setCapability("platform", Platform.XP);
capabilities.setCapability("name", scenarioName);
@jaxzin
jaxzin / install-rvm-on-mountain-lion.sh
Created November 19, 2012 14:43
Installing RVM on OS X Mountain Lion
# When Mac OS X Mountain Lion was released, I did a completely clean install. Unfortunately [RVM](http://rvm.io) won't install directly on the stock release. Here are the steps to get the installation working.
# This gist is based in part by [this post](http://theengguy.blogspot.ca/2012/04/setting-up-os-x-lion-and-mountain-lion.html) by [@theengguy](http://twitter.com/theengguy).
# 1. Install [MacPorts](http://www.macports.org)
# You can snag the package installer (easiest) from [https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg](https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg)
# 2. Install a new version of curl
sudo port -v selfupdate
sudo port install curl
@jaxzin
jaxzin / gist:2047489
Created March 15, 2012 22:59
Git aliases
# `git tracked` -- Show which remote branches are tracked and the associated local branch
git config --global alias.tracked "for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads"
@jaxzin
jaxzin / gist:2045327
Created March 15, 2012 17:07 — forked from nicholashagen/gist:2041175
Working with GitHub Forks

The following code is day-to-day operations when working with 3 forks: an open source project, a local fork of that project, and a company fork of that project. The power of Git is remote aliases that allow you to work with all 3 forks in parallel in the same code base and instantly compare, push, merge, etc.

Setup:

#> git clone [url of local fork: ie: username/project]
#> cd project
#> git remote add project [url of project: ie: project/project]
#> git remote add company [url of company fork: ie: company/project]