Skip to content

Instantly share code, notes, and snippets.

View maggiben's full-sized avatar

Benjamin maggiben

  • Frávega
  • Argentina
View GitHub Profile
@maggiben
maggiben / docker-compose.yml
Last active July 18, 2018 19:56
Node Dockerized
front:
build: .
ports:
- "80:80"
- "443:443"
- "9000:9000"
links:
- mysql:mysql
- mongo:mongo
- redis:redis
@maggiben
maggiben / ip.js
Created May 16, 2018 22:22
node ip
var os = require('os');
var ifaces = os.networkInterfaces();
// from https://stackoverflow.com/questions/3653065/get-local-ip-address-in-node-js
Object.keys(ifaces).forEach(function (ifname) {
var alias = 0;
ifaces[ifname].forEach(function (iface) {
if ('IPv4' !== iface.family || iface.internal !== false) {
@maggiben
maggiben / playlist.json
Created September 4, 2017 14:22
Ticker playlist.json
{
"id": "PLA0CA9B8A2D82264B",
"name": "My Playlist",
"tracks": [{
"id": "mCnJ2_xN2jU",
"title": "Daft Punk - Aerodynamic",
"name": "Daft Punk - Aerodynamic",
"artists": [{
"id": "sfasdf",
"name": "nook"
@maggiben
maggiben / Configuration.h
Created July 26, 2017 04:27
My Printer Settings
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@maggiben
maggiben / Parser.js
Created July 5, 2017 20:57
Template combiner
/**
* @desc Manufacture KPI Parser /api/situationroom/posters/manufacture/ShipmentByPlan
* Author: Benjamin at [email protected]
* Version: 0.1.0
*/
'use strict'
const debug = require('debug')(`esa:situationroom2:models:transport:v4:KpiParser`)
const _ = require('lodash')
const type = require('type-detect')
@maggiben
maggiben / getNumberSup.js
Created February 22, 2017 14:51
Get Sup Index Number
function getNumberSup(number) {
const sup = ['⁰','¹', '²', '³','⁴', '⁵', '⁶', '⁷', '⁸', '⁹'];
return number.toString().split('').map(x => (sup[parseInt(x)])).join('');
}
@maggiben
maggiben / modulecheck.js
Created February 22, 2017 04:54
Check package.json module versions
/* to move into a module */
import _ from 'lodash';
import fs from 'fs';
import path from 'path';
import globby from 'globby';
import Table from 'cli-table';
import packageJson from 'package-json';
import semver from 'semver';
import colors from 'colors';
import ProgressBar from 'progress';
@maggiben
maggiben / getQuarter.js
Created February 21, 2017 18:19
Get Quarter
function getQuarter(start, count, direction) {
var d = new Date(start);
var quarter = Math.floor((d.getMonth() / 3));
switch (direction) {
case "FORWARD": return new Date(d.getFullYear(), quarter * 3, 1);
case "BACKWARD": return new Date(d.getFullYear(), quarter * 3 - (3 * count), 1);
}
return null;
}
MKS BASE V1.3 32-bit
https://www.amazon.com/printer-motherboard-compatible-motherboards-Smoothieware/dp/B01KO57OGS/ref=sr_1_30?s=industrial&ie=UTF8&qid=1487182518&sr=1-30
var MAP = null;
// This example creates a simple polygon representing the Bermuda Triangle.
function initMap() {
MAP = new google.maps.Map(document.getElementById('map'), {
zoom: 2,
center: {
lat: 24.886,
lng: -70.268