Skip to content

Instantly share code, notes, and snippets.

@danielskapunk
danielskapunk / load_dotenv.sh
Created March 21, 2022 19:02 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@danielskapunk
danielskapunk / console.js
Last active March 11, 2019 17:17
Console log wrapper with line numbers
/**
* console wrapper with line numbers
* Usage:
* import * as c from 'console'
* c.log('abc');
*
* Ref: https://matthewspencer.github.io/console-log/
*/
/*eslint-disable */
@danielskapunk
danielskapunk / mongo group twice aggregate
Created November 3, 2017 20:25
Mongo Group Aggregate
//GROUP BY WORKSHOP ID
db.getCollection('enrolments').aggregate([{
$group:
{
_id: {workshopId: "$workshopId"},
contacts: { $push: {contactId: '$contactId'} }
}
}])
GROUP FIRST BY WEEKDAY AND WORKSHOP THEN BY WEEKDAY
@danielskapunk
danielskapunk / 0_reuse_code.js
Created April 12, 2017 10:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console