Skip to content

Instantly share code, notes, and snippets.

Working remotely

Will Willems NickolasBoyer

Working remotely
View GitHub Profile
NickolasBoyer / fullscreen-activate.js
Last active May 3, 2020
Put Roam Research in fullscreen by clicking anywhere.
View fullscreen-activate.js
((b) => { = 'white'; b.addEventListener('click', () => b.requestFullscreen(), {once: true})})(document.body)
NickolasBoyer / indent.js
Last active Apr 12, 2020
Indent browser CSS with a simple JS function
View indent.js
const indent = code => code
.replace(/{\s+/, '{\n ')
.replace(/(?<=;)\s+/gm, '\n ')
.replace(/(?<=;)\s+}/, '\n} ')
NickolasBoyer / background.js
Last active Jun 10, 2020
Custom webpack chunk loading from a web extension (Chrome) content script.
View background.js
// Throw this in your background script, it injects a generated webpack chunk when asked
chrome.runtime.onMessage.addListener(function ({ type, data}, sender, sendResponse) {
if (type === 'requestFileInjection') {
const file = data.fileName
if (!file) throw new Error('No file name provided.')
chrome.tabs.executeScript({ file: `${file}.js` }, (result) => {
console.log(`${file}.js injected`)
return sendResponse({ type: 'injected', target: { src: `${file}.js` }, success: true })
return true // return true so sendResponse stays valid
NickolasBoyer / download-zip.js
Created Aug 12, 2019
Get .zip file with Node, unzip it and save it to disk by piping the response body into unzipper
View download-zip.js
const unzipper = require('unzipper');
const fetch = require('node-fetch')
// get data
.then(resp => {
return new Promise((res, rej) => {
.pipe(unzipper.Extract({ path: '/tmp/my-archive' }))
.on('error', rej)
NickolasBoyer / AppCompass.vue
Created May 3, 2019
A compass indicator component for Vue.js
View AppCompass.vue
<div class="compass">
<!-- Arrow -->
<svg class="compass__arrow" :style="`transform: rotate(${degrees}deg);`" width="37px" height="36px" viewBox="0 0 37 36" version="1.1" xmlns="" xmlns:xlink="">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="spot-search-copy-10" transform="translate(-236.000000, -796.000000)">
<g id="Group" transform="translate(236.000000, 796.000000)">
<rect id="Rectangle" opacity="0" x="0.5" y="0" width="36" height="36"></rect>
<polygon id="Rectangle" fill="#FFFFFF" points="14 18 18.5 7 23 18 18.5292306 29"></polygon>
<polygon id="Rectangle" fill="#FF0000" transform="translate(18.500000, 12.500000) scale(1, -1) translate(-18.500000, -12.500000) " points="14 7 23 7 18.5292306 18"></polygon>
NickolasBoyer / upload.js
Created Jan 28, 2019
Upload email templates to Sparkpost
View upload.js
const fs = require('fs')
const path = require('path')
const SparkPost = require('sparkpost')
const templateFolder = './templates/html/'
const sparkpostApiKey = process.env.SPARKPOST_API_KEY
const client = new SparkPost(sparkpostApiKey)
NickolasBoyer / CompoundInterestCalculator.js
Last active Jul 2, 2018
Calculates total savings due to compund interest based on a yearly rate and a monthly deposit.
View CompoundInterestCalculator.js
// Calculates total savings as result of a monthly deposit.
// vars
var monthlySaving = 500; // monthly amount you deposit in your savings account/index fund
var initialSavings = 0; // initial capital you start with
var yearlyInterest = 1.05 // in this case %5
var years = 15; // amount of years to calculate for
var goal = 0 // financial goal, can leave at 0
// computed
NickolasBoyer /
Created Apr 9, 2018
Switch to wildcard SSL cert with certbot

If you want to switch from using a regulair certificate/certificates to using Let's Encrypt's new wildcard cert there are some things you still neeed to do, here is a simple command that should suffice:

sudo certbot certonly --cert-name -d *, --server --manual --preferred-challenges=dns

Certbot will walk you trough the verfication using DNS which currently is the only option with wildcard support, you'll need to add two TXT record for verification.

Good luck!

NickolasBoyer /
Last active Feb 18, 2017
Simple Python 3.5.2 Marktplaats scraping example with Beautiful Soup 4
import requests
import urllib.parse
import numpy as np
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
def crawlmp( base_url, parameters, add_to_url = '' ):
""" Parameters dictionairy can contain:
You can’t perform that action at this time.