Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin van Zonneveld kvz

View GitHub Profile
View merge-after-mass-linting-fix.md
cd ~/code/uppy
git checkout master
git status
# make sure to have a clean working tree
git pull
npm i # this installs master linting locally. may need to be `yarn` instead
git checkout $myBranch # e.g. `golden-retriever-ghosts-2`
git checkout master -- .eslintrc.json
git add .eslintrc.json
@kvz
kvz / prometheus-processes.sh
Created Jan 14, 2021
prometheus-processes.sh
View prometheus-processes.sh
#!/usr/bin/env bash
set -o pipefail
set -o errexit
set -o nounset
# set -o xtrace
newline=$'\n'
# ps %cpu is total consumption divided by total runtime, so we use
# the second iteration of top here to get a clean current value:
View locales.txt
aa_DJ
aa_ER
aa_ET
af_ZA
agr_PE
ak_GH
am_ET
an_ES
anp_IN
ar_AE
View gist:b43eaf0b6deba00be98c684d42ec2151
### Keybase proof
I hereby claim:
* I am kvz on github.
* I am kvz (https://keybase.io/kvz) on keybase.
* I have a public key ASBOLSEUJ1qnWYocbZI5HSEDtFxMFma0A4g47p_Hp1Oz6wo
To claim this, I am signing this object:
View configuration.nix
{config, pkgs, ...}:
let
unstable_pkgs = import (pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "a20a20f1363246000307e6dfeaf16d49daa4e06a";
sha256 = "06n770ia7s8wj7niisf9sazgq4g4q1sw5f8ah65h56k67dpdnpfq";
}) {};
in
View configuration.nix
{config, pkgs, ...}:
{
/*
Inspired by http://lethalman.blogspot.nl/2015/02/nixos-consul-nginx-and-containers.html
*/
nixpkgs.config.packageOverrides = pkgs: rec {
consul070 = pkgs.stdenv.lib.overrideDerivation pkgs.consul (oldAttrs: {
name = "consul-0.7.0";
@kvz
kvz / gist:e9f5b113f07763e49161
Last active Feb 21, 2016
todays-modal-todos.md
View gist:e9f5b113f07763e49161
Some todos I can think off:
- [ ] Make Modal prettier and accessible using Artur's research
- [ ] Convert `GoogleDrive` to adhere to `Dummy`'s format, so it'sare compatible with the new Modal
- [ ] Convert `DragDrop` to adhere to `Dummy`'s format, so it'sare compatible with the new Modal
- [ ] Make `ProgressBar` work with the new Modal
- [ ] Rename FakeModal to Modal, deprecating our old one
- [ ] Make the Modal look like Harry's sketchup
- [ ] ?
@kvz
kvz / coffee-to-es6.md
Last active Nov 15, 2017
Going from CoffeeScript to ES6
View coffee-to-es6.md

These are the steps I took to change a modest project from CoffeeScript to ES6.

My ~2000LoC project took me around 6 hours to port, but I sunk 3 hours into a stupid mistake, and 2 into figuring out these steps, so with these steps & warnings at your disposal already, you should be able to do bigger projects in considerably less time.

Automatic tools only take you so far, there will be some manual fixing. Sometimes the generated code clearly doesn't look like a human wrote it, and sometimes there are bugs.

In this last case, when porting software trips over a particular bit of CoffeeScript, comment this bit out, and try transpiling the file again. If this is successfull, you'll see the commented CoffeeScript inside the JS, and you can port that bit yourself.

Okay let's dive right in!

@kvz
kvz / Makefile
Last active May 7, 2021
The only Makefile for Node.js projects you'll ever need - https://twitter.com/kvz/status/685853830425231361
View Makefile
# Licensed under MIT.
# Copyright (2016) by Kevin van Zonneveld https://twitter.com/kvz
#
# This Makefile offers convience shortcuts into any Node.js project that utilizes npm scripts.
# It functions as a wrapper around the actual listed in `package.json`
# So instead of typing:
#
# $ npm script build:assets
#
# you could just as well type:
View gist:5247f77fa97235c3b7bb
"meta": {
"width": 500,
"height": 753,
"date_recorded": null,
"date_file_created": "2015/10/14 16:15:48",
"date_file_modified": "2015/11/18 13:28:12 GMT",
"title": "Terry%20Carkner",
"description": "Terry Carkner",
"location": null,
"aspect_ratio": "0.664",