Skip to content

Instantly share code, notes, and snippets.

@nf
nf / analyze.go
Last active Jan 12, 2016
'spent' script to log where time is spent
View analyze.go
package main
import (
"bufio"
"fmt"
"net/url"
"os"
"regexp"
"sort"
"strconv"
@josephholsten
josephholsten / sizeup.lua
Last active Mar 12, 2019
SizeUp in Hammerspoon
View sizeup.lua
-- === sizeup ===
--
-- SizeUp emulation for hammerspoon
--
-- To use, you can tweak the key bindings and the margins
local sizeup = { }
--------------
-- Bindings --
@sindresorhus
sindresorhus / np.sh
Last active Nov 14, 2019
shell function for publishing node modules with some goodies
View np.sh
# npm publish with goodies
# prerequisite: `npm install -g trash`
# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
# defaults to `patch`
np() {
trash node_modules &>/dev/null;
git pull --rebase &&
npm install &&
npm test &&
npm version ${1:-patch} &&
@getify
getify / better-web.md
Created Mar 12, 2019
Building That Better Web
View better-web.md

Building That Better Web

In honor of the 30th anniversary of the web, I wanted to share a few thoughts about what a better web could aspire to be, and challenge us to move toward it.

The Worser Web

It's tempting to frame "better" simply in terms of improvement and progress, as in how far the web has come over the last 20+ years. As a developer, I like many others get all too excited about fancy new features like Service Workers, WebRTC, and yes, even CSS Grids. The pace of change is dizzying, but it feels like a great problem to have too many awesome features to learn and use!

So in one practical respect, a better web is one that empowers developers and users alike to express themselves and connect with others more fluently.

@joevt
joevt / EDIDUtil.sh
Last active Dec 31, 2020
A set of shell functions used to view and edit EDIDs.
View EDIDUtil.sh
# by joevt Dec 17/2020
#=========================================================================================
# Modify EDID
getarrstart () {
# bash arrays start at 0
# zsh arrays start at 1 (applies only to [] syntax) but this can be changed with "setopt ksh_arrays"
# zsh arrays start at 0 when using ${arr:x:x} syntax
local arr=(1 0)
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active Jan 9, 2021
dm-crypt + dm-integrity + dm-raid = awesome!
View cryptsetup-with-luks2-and-integrity-demo.sh
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@jlongster
jlongster / immutable-libraries.md
Last active Jan 15, 2021
List of immutable libraries
View immutable-libraries.md

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@TRPB
TRPB / arch-macbook2018.md
Last active Jan 20, 2021
Guide: Running Arch on a 2018 MacBook Pro
View arch-macbook2018.md

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@harlow
harlow / golang_job_queue.md
Last active Jan 21, 2021
Job queues in Golang
View golang_job_queue.md
View patch-edid.rb
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten