Skip to content

Instantly share code, notes, and snippets.

peey /
Last active Jan 1, 2019
Browser monculture is bad. And it has real effects
peey / write-large-file.js
Last active Sep 8, 2019
Writes large files with low memory requirements
View write-large-file.js
var items = 2500000000; // number of lines to write to the file. Currently >20 GB for sequential ints
var buffer_size = 1000000; // amount of items to buffer in memory. Currently ~200 MB for ints
var fs = require('fs')
var buffer = [];
for (var i =0; i < items; i++) {
var data = i; // make it a random integer, or whatever else your heart desires
View better-new-twitter.css
/* don't make right sidebar sticky */
[data-testid=sidebarColumn] > div > div:nth-child(2) {
position: absolute;
/* dull out the empty space. Hardcoded colors for white theme. */
[data-testid='primaryColumn'] {
peey /
Created Jun 23, 2020
Add already checked out repo to git as submodule, automatically extract the remote URL from the repo on your local filesystem
#!/usr/bin/env fish
# based on
# tbh git should do better. It can record the particular commit and default remote
# instead of displaying "you accidentally added a git repo, did you mean to add a submodule?"
pushd $argv[1]
set url (git remote get-url (git remote))
git submodule add $url $argv[1]
View distraction-free-stackexchange.js
// ==UserScript==
// @name Hide Hot Network Questions and Hot Meta Posts
// @namespace http://CHANGE.TO.YOUR.WEBPAGE
// @version 0.2
// @description Hide Hot-Network-Questions in StackExchange sites
// @match *://**
// @match *://**
// @match *://**
// @match *://**
// @match *://**
peey /
Last active Aug 17, 2020
Install npm package via github PR

Install npm package from github PR

Locate the branch name associated with the PR

Use this but replace #commit with #branch-name.

Use the username of the PR sender (since branch exists on their repo while unmerged)

peey /
Created Nov 2, 2020 — forked from siwells/
A Python GUI "Hello World" using Tkinter
from tkinter import *
root = Tk()
w = Label(root, text="Hello World")