Skip to content

Instantly share code, notes, and snippets.

View pete-otaqui's full-sized avatar

Pete Otaqui pete-otaqui

View GitHub Profile
@pete-otaqui
pete-otaqui / hyper-sync-settings.json
Created November 8, 2016 09:08
hyper-sync-settings
{}
@pete-otaqui
pete-otaqui / css-onload.js
Created October 18, 2012 14:42
Load External Domain CSS, and get a Callback in IE7, IE8, IE9, FF, Chrome & Safari
function cssLoad(url, callback) {
var promise,
resolutions = [],
rejections = [],
resolved = false,
rejected = false,
count, id;
@pete-otaqui
pete-otaqui / currency-input.html
Last active January 2, 2016 10:59
CurrencyInput for automagic currency formatting of input fields
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Currency Input</title>
<style>
body {
font-family: OpenSans, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 32px;
}
@pete-otaqui
pete-otaqui / mountsshfs
Created October 4, 2013 07:27
Slightly modified sshmountfs script
#!/bin/sh
## http://ubuntuforums.org/showthread.php?t=430312
## The script will attempt to mount any fstab entry with an option
## "...,comment=$SELECTED_STRING,..."
## Use this to select specific sshfs mounts rather than all of them.
SELECTED_STRING="sshfs"
# Not for loopback
[ "$IFACE" != "lo" ] || exit 0
@pete-otaqui
pete-otaqui / bounce.html
Created June 5, 2013 07:57
Bouncy ball
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
padding: 0;
margin: 0;
@pete-otaqui
pete-otaqui / visibility-amd.js
Created May 23, 2013 12:02
Visibility API "polyfill-of-sorts"
/**
Visibility API polyfill-of-sorts
This is wrapped as an AMD module for convenience, and assumes
that you are using a 'pubusb' library of some kind. That's
all fairly easy to remove (amd and the dependency).
*/
define(['pubsub'], function (pubsub) {
'use strict';
@pete-otaqui
pete-otaqui / Gruntfile.js
Last active December 16, 2015 05:28
Minimal grunt setup for a local server and live reload
'use strict';
/**
* This file is mostly pulled from the one generate by Yeoman 1.0 Beta
**/
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
@pete-otaqui
pete-otaqui / colors.json
Created December 11, 2015 08:07
Monokai-style colours for windows 16-color command prompt
{
"black":"39/40/34",
"red":"249/38/114",
"green":"166/226/46",
"yellow":"244/191/117",
"blue":"102/217/239",
"magenta":"174/129/255",
"cyan":"161/239/228",
"white":"248/248/242",
"brightBlack":"117/113/94",
@pete-otaqui
pete-otaqui / wallmaker.js
Last active October 26, 2015 16:33
wallmaker - bad geometry
// do once per "row" (going down)
for ( let y=0; y<boxesDown; y++ ) {
// do once per "column" (going across)
for ( let x=0; x<boxesAcross; x++ ) {
// rx = top-left x coord of current square
let rx = x * size;
// ry = top-left y coord of current square
let ry = y * size;
// cx = centre point x coord of current square
@pete-otaqui
pete-otaqui / find_in_branches
Created January 12, 2012 10:37
Find File Path Pattern in all git branches
#!/bin/bash
# Authored by Pete Otaqui <pete@otaqui.com>
#
# Core code taken from StackOverflow
# http://stackoverflow.com/questions/372506/how-can-i-search-git-branches-for-a-file-or-directory
#
# The author has placed this work in the
# Public Domain, thereby relinquishing all
# copyrights. Everyone is free to use, modify,