Skip to content

Instantly share code, notes, and snippets.

@elazzabi
elazzabi / index.js
Created December 15, 2022 14:01
Transform your Revue newsletter issues to HTML
// Place the JSON exported from revue in the same directory, and rename it to items.json
// Or just change the path here
const items = require( './items.json' );
const issue_ids = new Set( items.map( t => t.issue_id ) );
const fs = require( 'fs' );
const issues = [ ...issue_ids ].map( id => {
const content = items.filter( i => i.issue_id === id ).sort( a => a.order ).map( t => {
switch( t.item_type ) {
case 'link':
@elazzabi
elazzabi / gist:94c2a319fa9d344be855b66fd27dbbeb
Created August 16, 2017 23:12 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile