Skip to content

Instantly share code, notes, and snippets.


Daniel Schildt d2s

View GitHub Profile

bad practice

sudo npm i -g <module>

good practice

npm config set prefix <directory>
simonw /
Created Mar 26, 2020
Making a Datasette of Finnish coronavirus data

TypeScript intro

How to setup TypeScript and use in a normal JavaScript project for learning purposes.


  • mkdir lab-ts
  • cd lab-ts
  • git init
  • touch .gitignore. Add node_modules and build to the file.
NeilJS / gist:32ac664f846bdea9aac25a428fe3727a
Created Sep 30, 2019
Chrome snippet: designMode="on" + kill all links
View gist:32ac664f846bdea9aac25a428fe3727a
// Disable anchor links
window.addEventListener("click", function (event) {
// Disable click eventlisteners
window.addEventListener("click", function (event) {
}, true);
// design mode on
document.designMode = "on";
View SpinningTorus3D.js
const Torus3D = {
props: {
// 3D -> 2D projection settings
camera: {
type: 'orthographic',
zoom: 2.25,
position: [ 1, 1, 1 ]
// Vertex transformation before screen space transformation
transform: {
d2s /
Created Jun 20, 2019
Pull changes from an upstream Git repository
#!/usr/bin/env bash
# Add `upstream` Git repository
# git remote add upstream
# Merge latest changes from the `upstream` Git repository
git fetch upstream
git checkout master
git merge upstream/master
View .bash_profile
listening() {
if [ $# -eq 0 ]; then
sudo lsof -iTCP -sTCP:LISTEN -n -P
elif [ $# -eq 1 ]; then
sudo lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color $1
echo "Usage: listening [pattern]"
illvart / meta-seo.njk
Last active Mar 10, 2020
My Eleventy project meta-seo.njk
View meta-seo.njk
{% if permalink == "/" %}
{% set canonicalUrl = metadata.canonicalUrl %}
{% else %}
{% set canonicalUrl = metadata.canonicalUrl + page.url %}
{% endif %}
<link rel="canonical" href="{{ canonicalUrl }}">
{# Social meta #}
{% if section == "articles" %}
<meta property="og:type" content="blog">
{% else %}
sw-yx /
Last active Oct 20, 2020
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos

You can’t perform that action at this time.