Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Linné erikjoens

View GitHub Profile
View setup.sh
#!/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
View keybase.md

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:

@erikjoens
erikjoens / cookie.js
Last active Jan 19, 2017
Script to set, remove and get a cookie.
View cookie.js
@erikjoens
erikjoens / fibonacci.js
Last active Nov 17, 2016
Recursive Fibonacci number generator
View fibonacci.js
function fib(i) {
return i > 1 ? ( fib(i - 1) + fib(i - 2) ) : i;
}
View pubsub.js
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 / throttle.js
Created Nov 17, 2016
Simple throttler
View throttle.js
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 / css-placeholder.css
Last active Jun 27, 2016
Style placeholder text, cross-browser
View css-placeholder.css
::-webkit-input-placeholder { /* Webkit, blink, edge */
/* ... */
}
:-moz-placeholder { /* Firefox 4-18 */
opacity: 1;
/* ... */
}
::-moz-placeholder { /* Firefox 19+ */
You can’t perform that action at this time.