Skip to content

Instantly share code, notes, and snippets.


Carlos Betancourt Carrero betacar

View GitHub Profile
jkrems /
Last active Jul 4, 2021
JavaScript: Classic Scripts vs. Modules vs. CommonJS

JavaScript File Format Differences

There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.

A certain point of view?

For many people writing JavaScript that gets passed into build tools,

lehno / sqs.mixin.js
Last active Oct 26, 2019
SQS Mixin
View sqs.mixin.js
'use strict';
// Use this produce and consume jobs from AWS SQS as a normal queue list.
// Just add as a mixin and listen to your queues
const { Consumer } = require('sqs-consumer');
const Producer = require('sqs-producer');
const _ = require('lodash');
const AWS = require('aws-sdk');
byrro /
Last active Aug 18, 2020
AWS Step Functions Example - Data Migration


This code snippet was extracted from an AWS Step Functions example.

It can ben found in the AWS Console for the Step Functions service.

Follow the instructions on this documentation page

Date: 2019-10-16

tobydeh /
Last active Apr 27, 2021
Moleculer k8 depoyment

Create a cluster on GKE:

gcloud container clusters create backend --num-nodes=2 --machine-type n1-standard-4

Get credentials:

gcloud container clusters get-credentials backend

Build the docker image:

snowkidind /
Last active Feb 10, 2021
TDAmeritrade API Notes for Node.js

Access to Ameritrade API

notes that may be helpful for node.js devs

What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...

Making an app

On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to and just grabbed the firs

View vscode favorite

Visual Studio Code shortcuts I use often


  • F8: jump to next error
  • Ctrl--: go back to previous code location


  • Cmd-Shift-F: search
jboner / OrderManagement.scala
Created Nov 10, 2017
Demo of an Event-driven Architecture in Akka and Scala. Show-casing Events-first DDD, Event Sourced Aggregates, Process Manager, etc.
View OrderManagement.scala
package sample.eventdriven.scala
import{Actor, ActorRef, ActorSystem, Inbox, Props}
import akka.persistence.PersistentActor
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration._
// ===============================================================
// Demo of an Event-driven Architecture in Akka and Scala.
sbolel /
Last active Aug 6, 2019
Guide: Set up a DC/OS Mesos cluster on Google Compute Engine

DCOS on Google Compute Engine

Original source: dcos-labs: DCOS on Google Compute Engine

This repository contains scripts to configure a DC/OS cluster on Google Compute Engine.

A bootstrap node is required to run the scripts and to bootstrap the DC/OS cluster.


View SVG_to_PNG.js
// Render SVG in canvas
var can = document.createElement("canvas")
var img = document.getElementsByTagName('img')[0] //
var img = document.createElement("img")
img.onload = function(){
can.height = img.height
can.width = img.width
can.getContext('2d').drawImage(img, 0, 0)
searls / github-wiki-override-test-double-style.css
Last active May 11, 2021
Some CSS that will make Github Wiki content full-screen friendly (useful when presenting). Override with your browser or an extension like greasemonkey or Stylish to apply to the wikis you want.
View github-wiki-override-test-double-style.css
/* and now with 100% more branding */
body { border: 10px solid #82FA32; min-height: 720px; }
.container { width: inherit; }
.header { display: none; }
.gh-header { padding: 30px 0px 30px 0px; background-color: black; color: white; }
.gh-header-actions { float: inherit; text-align: center; }
.btn-primary { border-color: #000; background-image: linear-gradient(#333, #000); }
.gh-header-actions .btn { float: inherit; }
.gh-header-title { padding-top: 20px; text-align: center; font-size: 4.2em; margin-right: 0px; font-weight: 100; }
.pagehead { display: none; }