Skip to content

Instantly share code, notes, and snippets.

Bob Arnott fatboab

View GitHub Profile
@fatboab
fatboab / fetch.js
Created Oct 4, 2016
Understanding fetch and promises
View fetch.js
fetch('http://httpbin.org/get?name=name&password=passwd')
.then(response => response.json())
.then(
data => console.log(`User - ${data.args.name}`),
error => console.log(error.message)
);
fetch('http://httpbin.org/status/401')
.then(response => response.json())
.then(
@fatboab
fatboab / develop-original.sh
Last active Sep 27, 2016
Preact Children Test
View develop-original.sh
#!/usr/bin/env bash
OUT_FODLER="build"
SASS_OPTIONS="--output-style expanded --indent-type space --indent-width 4 --linefeed lf --precision 8"
SASS_FOLDERS="--output ${OUT_FODLER}/css src/scss"
rm -rf ${OUT_FODLER}
mkdir -p ${OUT_FODLER}/js
node-sass ${SASS_OPTIONS} ${SASS_FOLDERS}
@fatboab
fatboab / alac2flac.sh
Created Nov 25, 2014
Convert ALAC to FLAC
View alac2flac.sh
for f in *.m4a; do avconv -i "$f" -acodec flac "${f%.m4a}.flac"; done
@fatboab
fatboab / untappd.py
Last active Dec 17, 2015
Copy of the code out of my Untappd Data Visualisation repo so that I can embed it in Wordpress...
View untappd.py
from pymongo import MongoClient
import requests
# Your Untappd details...
untappd_user = ''
untappd_client_id = ''
untappd_client_secret = ''
# Connect to the local MongoDB instance...
client = MongoClient()
@fatboab
fatboab / mount-points.sh
Created Jan 10, 2013
Thecus N3200 NAS mount points from /etc/fstab
View mount-points.sh
# Thecus N3200 mount points, assuming your NAS has a fixed IP of 192.168.0.100
192.168.0.100:/raid/Bob /home/boba/nas/bob nfs rw
192.168.0.100:/raid/Photos /home/boba/nas/photos nfs rw
192.168.0.100:/raid/Music /home/boba/nas/music nfs rw
192.168.0.100:/raid/Video /home/boba/nas/video nfs rw
@fatboab
fatboab / no-third-party-libs.sh
Last active Dec 10, 2015
Setting the HADOOP_CLASSPATH...
View no-third-party-libs.sh
# Assuming you are seting this from the same folder as you
# are building your code with Maven...
export HADOOP_CLASSPATH=./target/classes
@fatboab
fatboab / maven-dependency-plugin.xml
Created Jan 9, 2013
Maven dependency plugin config to exclude both provided and test scopes.
View maven-dependency-plugin.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
@fatboab
fatboab / extract-flac.sh
Created Aug 23, 2012
Recursively extract FLAC audo from MKV files in the current folder.
View extract-flac.sh
#!/bin/bash
find . -type f -name *.mkv | while read filename; do mkvextract tracks "$filename" 3:"${filename%.*}".flac; done
@fatboab
fatboab / Binding.js
Created May 31, 2012
I always forget to bind the Backbone save success and error functions to this...
View Binding.js
Backbone.View.extend({
events: {
'click a.enable': 'enableHandler',
'click a.disable': 'disableHandler'
},
initialize: function() {
this.model = new Model();
this.model.bind('change', this.render, this);
You can’t perform that action at this time.