Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am kmaschta on github.
  • I am kmaschta ( on keybase.
  • I have a public key ASCZaN5SJpgXVcd7XuqosiSCH_kN_xMilDHnwFZ4isGu6wo

To claim this, I am signing this object:

View Parse-International-Days.js
(() => {
const links = {};
const articles = document.querySelectorAll('article');
articles.forEach((article, monthIndex) => {
const items = article.querySelectorAll('li');
items.forEach((li) => {
Kmaschta /
Created Jan 9, 2019
How to generate a self-signed that is valid for your browser (by creating your custom certificate authority)

If you're using self-signed certificate for your web server on development, you might know the browser warning saying that your certificate isn't valid. If like me you had manually added an exception for this certificate error each time it showed up, this gist is for you.

Properly Configure OpenSSL with your DNS aliases

You'll have to create a self-signed certificate with a custom SubjectAltName.

  1. Find your openssl config. find /usr/lib -name openssl.cnf
View gist:bf07f6544b12806ae3b0dde2e571c5e7
### Keybase proof
I hereby claim:
* I am kmaschta on github.
* I am kmaschta ( on keybase.
* I have a public key ASAvkWIvIk1a3VcepH9b0Rl9_wd2ECc7UaHwaUDbLtBuIwo
To claim this, I am signing this object:
Kmaschta / index.js
Created Mar 6, 2018
Apollo Memory Debug
View index.js
const express = require('express');
const { makeExecutableSchema } = require('graphql-tools');
const graphqlHTTP = require('express-graphql');
const books = [
{ title: "Harry Potter and the Sorcerer's stone", author: "J.K. Rowling" },
{ title: "Jurassic Park", author: "Michael Crichton" },
Kmaschta / index.js
Created Feb 12, 2018
Express-Winston Benchmark
View index.js
const express = require('express');
const winston = require('winston');
const expressWinston = require('./express-winston');
const app = express();
const consoleFormatter = ({ level, meta: { req, res, responseTime, stack } }) => {
let msg = `${winston.config.colorize(level, level)} HTTP ${req.method} ${req.url}`;
if (res) {
Kmaschta / Makefile
Created Dec 12, 2017
Artifact deployment example
View Makefile
.PHONY: build
TAG ?=
SERVER ?= staging-server
npm install
node --require reify server.js
Kmaschta / setup-tests.js
Created Oct 27, 2017
Prevent unhandled Promise rejection errors
View setup-tests.js
// Warn from unhandled promise rejection that can occurs without failing tests
// jest --setupFiles setup-tests.js
process.on('unhandledRejection', (error, promise) => {
console.error('Unhandled Rejection at:', promise, `\n${error.stack}`);
Kmaschta /
Created May 5, 2017
Retrieve a maximum of Wakatime stat
help = """Retrieve all the stats from WakaTime API
Usage: <token>
-h --help Show this very help message
Kmaschta /
Last active Mar 22, 2017 — forked from albertstartup/
AWS GPU / P2, Ubuntu 16.04, Nvidia driver 375 & CUDA 8.0, decred/gominer
# Requirements
# - NVIDIA Driver - -
# - CUDA runfile (local) - -
sudo apt update -y && sudo apt upgrade -y
sudo apt install build-essential linux-image-extra-`uname -r` -y
chmod +x