Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlos Betancourt Carrero betacar

View GitHub Profile
@jkrems
jkrems / index.md
Last active Jan 10, 2021
JavaScript: Classic Scripts vs. Modules vs. CommonJS
View index.md

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
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
byrro / CREDITS.md
Last active Aug 18, 2020
AWS Step Functions Example - Data Migration
View CREDITS.md

CREDITS

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
tobydeh / moleculer-k8.md
Last active Dec 14, 2020
Moleculer k8 depoyment
View moleculer-k8.md

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
snowkidind / README.md
Last active Nov 8, 2020
TDAmeritrade API Notes for Node.js
View README.md

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 https://www.uuidgenerator.net/ and just grabbed the firs

View vscode favorite shortcuts.md

Visual Studio Code shortcuts I use often

Navigate:

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

Sidebar:

  • Cmd-Shift-F: search
@sbolel
sbolel / DCOS-on-Google-Compute-Engine.md
Last active Aug 6, 2019
Guide: Set up a DC/OS Mesos cluster on Google Compute Engine
View DCOS-on-Google-Compute-Engine.md

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.

PLEASE READ THE ENTIRE DOCUMENT. YOU MUST MAKE CHANGES FOR THE SCRIPTS TO WORK IN YOUR GCE ENVIRONMENT.

View SVG_to_PNG.js
// Render SVG in canvas
var can = document.createElement("canvas")
var img = document.getElementsByTagName('img')[0] // http://web.mit.edu/remy/
/*
var img = document.createElement("img")
img.onload = function(){
*/
can.height = img.height
can.width = img.width
can.getContext('2d').drawImage(img, 0, 0)
@searls
searls / github-wiki-override-test-double-style.css
Last active Aug 29, 2015
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; }
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active Jan 20, 2021
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View nodejs-cheatsheet.js
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
You can’t perform that action at this time.