Skip to content

Instantly share code, notes, and snippets.

View curdin's full-sized avatar

Curdin Krummenacher curdin

  • Wellington, New Zealand
View GitHub Profile
[{
"programmeId": 1,
"title": "a7re0q",
"image": "https://static1.radionz.co.nz/assets/programmes/brand_image/47/medium_caravan-sq.jpg?1481595797",
"contentType": "programme",
"webLink": "https://www.radionz.co.nz/national/programmes/a7re0q"
}, {
"programmeId": 2,
"title": "8zwros",
"image": "https://static1.radionz.co.nz/assets/programmes/brand_image/47/medium_caravan-sq.jpg?1481595797",
VBoxManage clonehd "source.vmdk" "cloned.vdi" --format vdi
VBoxManage modifyhd "cloned.vdi" --resize 51200
VBoxManage clonehd "cloned.vdi" "resized.vmdk" --format vmdk
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
export PATH="/Users/username/.pyenv:$PATH"
eval "$(pyenv init -)"
export CLICOLOR=1
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
## Revert to an older commit through a new commit
git revert --no-commit a05d181..HEAD
git commit
# To set the http_proxy and https_proxy vars on OSX. Suitable for Automator bash.
grep -q 'export http_proxy' /Users/<username>/.bash_profile && sed -i -e 's/^export http_proxy.*/export http_proxy="http:\/\/172.30.1.1:8080"/' /Users/<username>/.bash_profile || echo 'export http_proxy="http://172.30.1.1:8080"' >> /Users/<username>/.bash_profile
grep -q 'export https_proxy' /Users/<username>/.bash_profile && sed -i -e 's/^export https_proxy.*/export https_proxy="http:\/\/172.30.1.1:8080"/' /Users/<username>/.bash_profile || echo 'export https_proxy="http://172.30.1.1:8080"' >> /Users/<username>/.bash_profile
# To unset
grep -q '^export http_proxy' /Users/<username>/.bash_profile && sed -i -e 's/export http_proxy.*/export http_proxy=""/' /Users/<username>/.bash_profile || echo 'export http_proxy=""' >> /Users/<username>/.bash_profile
window.console.log("\n%cKia Ora,\n\n%cDo you want to be part of building the new digital Te Papa? \nJoin us at %chttp://jobs.tepapa.govt.nz", "font-family: aktiv-grotesk,sans-serif; font-size: 32px; font-weight:700; color: #333", "font-family: museo-slab, Georgia, serif; font-size: 16px; color: #444", "font-family: museo-slab, Georgia, serif; font-size: 16px; color: #557500; text-decoration: underline");
@curdin
curdin / kitchensink.html
Created February 17, 2016 20:05 — forked from ethyde/kitchensink.html
Kitchen Sink HTML
<article>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<section>
<h1>Heading 1 (in section)</h1>
@curdin
curdin / dbcommands
Last active April 27, 2017 20:59
Mysql database dump and restore commands from bash
== BACKUP ==
mysqldump -u USER -p DATABASE | gzip > FILENAME.$(date +%FT%H%M).sql.gz
== RESTORES (**CAREFUL**) ==
gzipped
zcat FILENAME.SQL.GZ | mysql -u USER -p DATABASE
bzipped
@curdin
curdin / JS GA navigation event tracking
Last active August 29, 2015 14:07
Sends link click events to GA. Has a couple of safeties in case (1) GA library hasn't loaded, and (2) there are connectivity issues to GA
function trackLinkEvent(link, cat) {
var href = link.attr('href'),
title = link.text();
/* Navigate to the next page once the event has been tracked */
if( typeof ga != "undefined" ) {
ga('send', 'event', cat, "Click", title, {
'hitCallback': function () {
document.location = href;
@curdin
curdin / JS cookie reader and writer functions
Created May 1, 2014 03:46
Simple functions to read and write cookies