Skip to content

Instantly share code, notes, and snippets.

@Kmaschta
Kmaschta / keybase.md
Created January 15, 2021 11:22
Keybase Proof

Keybase proof

I hereby claim:

  • I am kmaschta on github.
  • I am kmaschta (https://keybase.io/kmaschta) on keybase.
  • I have a public key ASCZaN5SJpgXVcd7XuqosiSCH_kN_xMilDHnwFZ4isGu6wo

To claim this, I am signing this object:

@Kmaschta
Kmaschta / Parse-International-Days.js
Created April 29, 2019 11:44
Parse International Days
// https://www.journee-mondiale.com/les-journees-mondiales.htm
(() => {
const links = {};
const articles = document.querySelectorAll('article');
articles.forEach((article, monthIndex) => {
const items = article.querySelectorAll('li');
items.forEach((li) => {
@Kmaschta
Kmaschta / generate-self-signed-certificate-with-custom-CA.md
Created January 9, 2019 14:43
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
### Keybase proof
I hereby claim:
* I am kmaschta on github.
* I am kmaschta (https://keybase.io/kmaschta) on keybase.
* I have a public key ASAvkWIvIk1a3VcepH9b0Rl9_wd2ECc7UaHwaUDbLtBuIwo
To claim this, I am signing this object:
@Kmaschta
Kmaschta / index.js
Created March 6, 2018 07:11
Apollo Memory Debug
require('isomorphic-fetch');
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
Kmaschta / index.js
Created February 12, 2018 12:48
Express-Winston Benchmark
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
Kmaschta / Makefile
Created December 12, 2017 16:49
Artifact deployment example
.PHONY: build
TAG ?=
SERVER ?= staging-server
install:
npm install
start:
node --require reify server.js
@Kmaschta
Kmaschta / setup-tests.js
Created October 27, 2017 09:40
Prevent unhandled Promise rejection errors
// 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
Kmaschta / wakatime_stats.py
Created May 5, 2017 15:21
Retrieve a maximum of Wakatime stat
#!/usr/bin/python
help = """Retrieve all the stats from WakaTime API
Usage:
wakatime_stats.py <token>
Options:
-h --help Show this very help message
See https://wakatime.com/developers
@Kmaschta
Kmaschta / install-gominer.sh
Last active March 22, 2017 14:25 — forked from albertstartup/steps.sh
AWS GPU / P2, Ubuntu 16.04, Nvidia driver 375 & CUDA 8.0, decred/gominer
#!/bin/bash
# Requirements
# - NVIDIA Driver - NVIDIA-Linux-x86_64-375.39.run - http://www.nvidia.fr/Download/index.aspx
# - CUDA runfile (local) - cuda_8.0.61_375.26_linux.run - https://developer.nvidia.com/cuda-downloads
sudo apt update -y && sudo apt upgrade -y
sudo apt install build-essential linux-image-extra-`uname -r` -y
chmod +x NVIDIA-Linux-x86_64-375.39.run