Skip to content

Instantly share code, notes, and snippets.

@goliatone
goliatone / baseConverter.js
Created January 7, 2017 16:25 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <[email protected]>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
@goliatone
goliatone / logger.js
Created December 8, 2016 21:50 — forked from transitive-bullshit/logger.js
winston logger with filename:linenumber
// NOTE: this adds a filename and line number to winston's output
// Example output: 'info (routes/index.js:34) GET 200 /index'
var winston = require('winston')
var path = require('path')
var PROJECT_ROOT = path.join(__dirname, '..')
var logger = new winston.logger({ ... })
// this allows winston to handle output from express' morgan middleware
@goliatone
goliatone / git-aliases.md
Created November 25, 2016 03:56 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
#include <FastLED.h>
FASTLED_USING_NAMESPACE
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
#define DATA_PIN D7
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#include <ESP8266WiFi.h>
#include "FastLED.h"
#include "EEPROM.h"
#define DATA_PIN 4
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB * leds;
uint16_t NUM_LEDS = 1;
@goliatone
goliatone / gmail.stylish.css
Last active November 4, 2016 14:19
Gmail Dark - stylish update
@-moz-document domain("mail.google.com") {
.adp {
background: none !important;
}
#account-chooser-add-account, .aJ6 {
color: #000 !important;
}
@goliatone
goliatone / README.md
Last active November 3, 2016 20:35
Configure RPi 3 running HypriotOS v1 to run as a beacon

Setup RPi as iBeacon HypriotOS

On a fresh HpryotOS image, bluez is already installed and running. If you run the following command:

$ sudo hciconfig dev
hci0:	Type: BR/EDR  Bus: UART
	BD Address: B8:27:EB:B0:55:A9  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:724 acl:0 sco:0 events:43 errors:0
@goliatone
goliatone / README.md
Last active October 19, 2016 17:36
Waterline BaseModel

Waterline BaseModel

Creating a Waterline BaseModel where extended collections automagically call afterCreate, afterUpdate, afterDestroy of BaseModel.

We could achieve the same by simple calling the super method:

petCollection.__super__.afterUpdate(record, next);
@goliatone
goliatone / ENTITIES.md
Last active October 13, 2016 17:59
WIP Menagerie docs

Entities

Entities have an universally unique identifier UUID. Menagerie creates a QR code for Devices and Locations upon record creation.

The main entities in Menagerie are:

  • Device
  • DeviceType
  • Location
  • Deployment