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(
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}
View alac2flac.sh
for f in *.m4a; do avconv -i "$f" -acodec flac "${f%.m4a}.flac"; done
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()
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
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
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>
View extract-flac.sh
#!/bin/bash
find . -type f -name *.mkv | while read filename; do mkvextract tracks "$filename" 3:"${filename%.*}".flac; done
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);