Skip to content

Instantly share code, notes, and snippets.

<script>
import {scaleBand, scaleLinear} from 'd3-scale';
import {csvParse} from 'd3';
import * as cloud from 'd3-cloud'
import { fly} from 'svelte/transition';
let years = [], selectedYear = 2020, textFile = "", nameData = [], letters = [], letterNames = {}, letterCounts = [];
for(let y = 1880; y<=2020; y++){
years.push(y);
}
@nokidding
nokidding / updateNpm.bat
Created March 31, 2020 13:08
Windows batch file which updates npm for nvm-windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@danharper
danharper / background.js
Last active April 29, 2025 04:09
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});