Skip to content

Instantly share code, notes, and snippets.

View erikjoens's full-sized avatar

Erik Linné erikjoens

View GitHub Profile
@erikjoens
erikjoens / css-placeholder.css
Last active June 27, 2016 13:00
Style placeholder text, cross-browser
::-webkit-input-placeholder { /* Webkit, blink, edge */
/* ... */
}
:-moz-placeholder { /* Firefox 4-18 */
opacity: 1;
/* ... */
}
::-moz-placeholder { /* Firefox 19+ */
@erikjoens
erikjoens / throttle.js
Created November 17, 2016 19:55
Simple throttler
function throttle(fn, threshhold, scope) {
threshhold || (threshhold = 250);
var last,
deferTimer;
return function () {
var ctx = scope || this;
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {
@erikjoens
erikjoens / pubsub.js
Created November 17, 2016 20:00
Simple PubSub
var pubsub = function() {
var topics = {}, subUid = -1;
this.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
var token = (++subUid).toString();
topics[topic].push({
token: token,
@erikjoens
erikjoens / fibonacci.js
Last active November 17, 2016 20:17
Recursive Fibonacci number generator
function fib(i) {
return i > 1 ? ( fib(i - 1) + fib(i - 2) ) : i;
}
@erikjoens
erikjoens / cookie.js
Last active January 19, 2017 21:54
Script to set, remove and get a cookie.

Keybase proof

I hereby claim:

  • I am erikjoens on github.
  • I am erikjoens (https://keybase.io/erikjoens) on keybase.
  • I have a public key ASDsFiqGoAPCdSuINtc0QzBiZ-tJRf4NbSRrxany8jogVAo

To claim this, I am signing this object:

#!/bin/bash
# setup.sh will install all necessary files for the compose file to be runnable from a clean rasbian installation.
# Ensure we are root
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root, eg. \"sudo ./setup.sh\"" ; exit 1 ; fi
echo "---------------------------------------------------------------------------"
echo "This script is intended to be run on a fresh install of RASPBIAN STRETCH LITE"
echo "other usage has not been tested."
echo