Skip to content

Instantly share code, notes, and snippets.

View restartgoroutine.go
package main
import "fmt"
// number of desired workers
const nWorkers = 10
func main() {
// make a buffered channel with the space for my 10 workers
workerChan := make(chan *worker, nWorkers)
View getUCPEnv.js
var output = "";
var rowsTable = document.getElementsByClassName("ReactVirtualized__Table__row styles__row___3MKZR");
for(var i = 0; i < rowsTable.length; i++) {
var el = rowsTable[i];
var rowsInTable = el.querySelectorAll("div");
output += '- name: ' + rowsInTable[0].innerText + '\n';
output += ` value: "${rowsInTable[1].innerText}"\n`
mbecker / comunioTransfermarkt.js
Last active Sep 26, 2019
Read name, points and market value for each team member at the transfer page
View comunioTransfermarkt.js
var tradable = document.getElementsByClassName("tradable");
var output = "";
var dt = new Date().toISOString().substr(0, 10);
for (let i=0; i<tradable.length; i++) {
var el = tradable[i];
// Name
var tradablename = el.getElementsByClassName("tradablename")[0];
var name = tradablename.getElementsByClassName("name")[0].innerText;
View cloudSettings
View FlattenObject.js
// Source: - Webber
* Flatten a multidimensional object
* For example:
* {
* "a": 1,
* "b": {
* "c": 2,
View RandomUserProfileNames.js
// Names by:
const names = ["Emily Mcpherson", "Trinity Taylor", "Rodolfo Good", "Lilliana Atkinson", "Brisa Cummings", "Javier Alexander", "Elsa Pineda", "Valentin Blackwell", "Mallory Morton", "Ross Ho", "Rihanna Barry", "Aubree Solis", "Mercedes Henderson", "Shaun Cooper", "Kamora Mckinney", "Maleah Farrell", "Makenna Obrien", "Patricia Zuniga", "Giancarlo Mcpherson", "Alessandra Cortez", "Erin Robles", "Lilyana Chapman", "Rhys Jimenez", "Justine Lara", "Lennon Brandt", "Bruce Weaver", "Kash Rivera", "Kamron Pugh", "Jazlene Ross", "Ishaan Page", "Killian Norman", "Kiersten Hahn", "Azul Mooney", "Roselyn Ware", "Davian Bennett", "Kymani Frank", "Nayeli Robertson", "Juan Rivas", "Jaylyn Melton", "Jamison Cowan", "Malaki Quinn", "Miguel Molina", "Leonidas Bishop", "Sage Richmond", "Gary Brandt", "Ross Barton", "Efrain Patton", "Rohan Best", "Griffin Bishop", "Rosa Hines", "Makena Rowland", "Aden Mckay", "Elisa Ponce", "Marianna Jacobs", "Jayvion Flores", "Princess Schm
View userprofiles.js
// User profile images from:
const profiles = [

Step 1: Commit all your changes

Before proceeding, make sure all your changes are committed, including your .gitignore file.

Step 2: Remove everything from the repository

To clear your repo, use:

git rm -r --cached .
mbecker /
Created Mar 8, 2019
Golang cheatsheet #golang #cheatsheet


Migrating from dep to Go 1.11 modules

- move your code outside of GOPATH
- go mod init [module path]: this will import dependencies from Gopkg.lock.
- go mod tidy: this will remove unnecessary imports, and add indirect ones.
- rm -fr vendor/
- go build: is everthing ok?
mbecker / Postresql_Table_Size.sql
Created Nov 1, 2018
Get the tables size of postgreql
View Postresql_Table_Size.sql
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
pg_table_size(table_name) AS table_size,
pg_indexes_size(table_name) AS indexes_size,