Skip to content

Instantly share code, notes, and snippets.

@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@daniellevass
daniellevass / idiots-guide-to-littlebits-cloudbit-api.md
Last active May 22, 2018 19:48
Idiots Guide to Using littleBits cloudBit API

#Idiots Guide to Using littleBits cloudBit API

##Introduction

  1. Connect a cloudBit to your network using the instructions at http://control.littlebitscloud.cc/
  2. Find out your AccessToken
  • visit http://control.littlebitscloud.cc/
  • on the left hand side select any of your cloudBits
  • using the tab bar at the bottom select settings
  • scroll down and copy your AccessToken
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing
@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {
{
"directory": "components"
}
@mkuklis
mkuklis / gist:5294248
Last active September 7, 2021 21:39
auto curry in JavaScript
function toArray(args) {
return [].slice.call(args);
}
function autocurry(fn) {
var len = fn.length;
var args = [];
return function next() {
args = args.concat(toArray(arguments));
return (args.length >= len) ?
@eeroan
eeroan / papply.js
Last active December 15, 2015 02:19
Awesome partial application function for JavaScript
var __ = {}
function papply(func, givenArguments) {
var indexOf = givenArguments.indexOf(__)
var givenArgsSize = givenArguments.length
var requiredArgsSize = func.length
if(givenArgsSize >= requiredArgsSize && (indexOf < 0 || indexOf >= requiredArgsSize))
return func.apply(func, givenArguments)
else
return function() {
return (function(givenArguments, remainingArguments) {