Skip to content

Instantly share code, notes, and snippets.

View fatboab's full-sized avatar
🤦
Srsly...‽

B O A B fatboab

🤦
Srsly...‽
View GitHub Profile
@fatboab
fatboab / fetch.js
Created October 4, 2016 22:23
Understanding fetch and promises
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 September 27, 2016 10:58
Preact Children Test
#!/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
Last active October 6, 2021 13:35
Convert audio to FLAC
for f in *.m4a; do avconv -i "$f" -acodec flac "${f%.m4a}.flac"; done
@fatboab
fatboab / untappd.py
Last active December 17, 2015 21:39
Copy of the code out of my Untappd Data Visualisation repo so that I can embed it in Wordpress...
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 January 10, 2013 12:02
Thecus N3200 NAS mount points from /etc/fstab
# 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 December 10, 2015 21:30
Setting the HADOOP_CLASSPATH...
# 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 January 9, 2013 16:09
Maven dependency plugin config to exclude both provided and test scopes.
<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 August 23, 2012 10:41
Recursively extract FLAC audo from MKV files in the current folder.
#!/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 10:08
I always forget to bind the Backbone save success and error functions to this...
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);