Skip to content

Instantly share code, notes, and snippets.

Mark Robson roppa

Block or report user

Report or block roppa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
roppa / game-of-life.js
Last active Aug 29, 2019
Game of life experiment
View game-of-life.js
Quick POC for game of life. Terrible side effects. Actually doing this in Rust but wanted to quickly knock something out in js
let width = 40
function getCells() {
return new Array(width * width).fill(false)
let cells = getCells()
roppa /
Created Dec 12, 2018
Git pull origin master in folder containing many git repos
for f in $PWD/*;
[ -d $f ]
cd "$f"
echo $f
git pull origin master
roppa /
Created Dec 12, 2018
Bash Pull Repos
# To run ./ username
repos=( repo1 repo2 repo3 )
for i in "${repos[@]}"
git clone$1/$i.git
roppa /
Created Aug 8, 2018 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
roppa /
Created Apr 3, 2018 — forked from cecilemuller/
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

roppa / watch node.js
Created Mar 1, 2018
Watch files and run tests on change
View watch node.js
npm i -g watch
watch 'npm run test' src
roppa / json-path-export.js
Created Mar 1, 2018
Executable script, takes in target json file, output json file, and a string of the json path you want to export, like 'parent.child.child'
View json-path-export.js
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const from = JSON.parse(fs.readFileSync(path.resolve(process.argv[2])).toString());
const to = path.resolve(process.argv[3]);
const jsonPath = process.argv[4].split('.');
function getValueFromPaths(paths, object) {
roppa / socket-client-server.js
Created Jul 12, 2017
Node.js socket server and client
View socket-client-server.js
const net = require('net');
const PORT = 6000;
const server = net.createServer((connection) => {
console.log('created server');
connection.on('data', (data) => {
roppa / .vimrc
Created May 12, 2017 — forked from substack/.vimrc
my vimrc
View .vimrc
set autoindent
set indentexpr=off
set expandtab
set tabstop=4
set sw=4
set textwidth=80
set nohls
set noshowmatch
syntax enable
You can’t perform that action at this time.