Skip to content

Instantly share code, notes, and snippets.


Nic Haynes nicinabox

View GitHub Profile
nicinabox / gist:9213299
Created Feb 25, 2014
Backup configs on unraid VMs
View gist:9213299


$ configs backup
=> Backing up sabnzbd
=> Backing up sickbeard

$ configs restore
=> Restoring up sabnzbd

=> Restoring up sickbeard

mkdir -p "$PREFIX" && \
curl$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \
| tar xzvf - --strip-components=1 -C "$PREFIX"
nicinabox /
Created Apr 25, 2014
Wrap Backbone's render function and fire a render event
class Backbone.View extends Backbone.View
constructor: ->
@render = _.wrap @render, (viewRender, args) =>
viewRender = _.bind viewRender, this
setTimeout =>
View gist:98f379fb0f9adbcac98f
new Shortcode(document.querySelector('body'), {
button: function(done) {
sc_sn(this, 'button', done);
sc_sn = function(match, done) {
success: function() {
var replacementValue = '...';
View gist:6b0486bb1ce812806f5d
var _ = require('lodash');
var natural = require('natural'),
classifier = new natural.BayesClassifier();
// First item denotes "changed motor oil"
var notes = [
[true, 'Change oil, oil filter, air filter, spark plugs'],
[true, 'Change oil, oil filter. 4qt Rotella T6, 0.5 Mobil 1 5W-40'],
[false, 'Change gearbox oil, rear drive oil, valve adjustment, torque heads'],
[false, 'Change transmission oil'],
View makepem
#!/usr/bin/env ruby
class MakePEM
def initialize(argv)
@file = argv[0]
abort help unless valid_args
parts = @file.split('.')
@name = parts.first
nicinabox / server.js
Created Apr 12, 2015
A handy server to use in development
View server.js
var connect = require('connect')
var http = require('http')
var serveStatic = require('serve-static')
var PORT = 8000;
var app = connect()
app.use(serveStatic(__dirname + '/public'))
View tokens.txt
- Change oil, oil filter. 4qt Rotella T6, 0.5 Mobil 1 5W-40
- Change oil, oil filter, air filter, spark plugs
- Oil, oil filter, gearbox oil, rear drive oil, valve adjustment, torque heads
- Change oil and oil filter
- Changed oil and filter
- Changed oil with Castrol GTX 5w-30 and new filter
- New Tensioner - AC Delco (Littens) \nNew O-Ring for Front Crank Sensor\nOil Change (Royal Purple 5w30)
View gist:790299
$('form').submit(function() {
// get all the inputs into an array.
var $inputs = $('#form :input');
// get an associative array of just the values.
var values = {};
$inputs.each(function() {
values[] = $(this).val();
if ($(this).val() == "") {
alert("You haven't filled out all the fields");
View gist:869865
users = []'//dc:creator').each do |user|
unless users.include?(user)
users << user.inner_text