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 / 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 / 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 / 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 / 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 / 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 / wordify.js
Created July 1, 2019 18:51
replace underscore with spaces and uppercase each word
"animal_brand_name".replace(/_/g, ' ').replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
@maggiben
maggiben / nextRun.js
Last active July 23, 2019 16:08
Given a date and a recurrence rule show the next occurrence
var options = RRule.parseString('FREQ=MONTHLY;INTERVAL=1');
options.dtstart = moment.utc('2019-05-16 12:30:00').toDate();
options.count = 2;
var rule = new RRule(options)
var nextRun = rule.all().slice(-1).pop();
console.log(moment(nextRun).format('YYYY-MM-DD H:mm:ss'));
@maggiben
maggiben / capitalizeUnderscore.js
Created November 11, 2019 12:45
Capitalize undescore words
'hello_my_name_is_ben'.replace(/_/g, ' ').replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
// Hello My Name Is Ben
@maggiben
maggiben / forrajeria.psc
Created November 28, 2019 21:18
Forrajeria
Funcion suma <- totalFacturado ( facturas )
suma <- 0
Para i<-1 Hasta 5 Con Paso 1 Hacer
suma <- suma + facturas[i, 4]
Fin Para
Fin Funcion
Funcion suma <- totalKilos ( facturas )
suma <- 0
Para i<-1 Hasta 5 Con Paso 1 Hacer
import * as React from 'react';
import {
Icon,
MainSectionLayoutTypes,
MainSectionLayout,
Button
} from 'osp-ui-components';
import { FormattedMessage } from 'react-intl';