Skip to content

Instantly share code, notes, and snippets.

Mathias Fredriksson mafredri

Block or report user

Report or block mafredri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
@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} &&
@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 --
@harlow
harlow / golang_job_queue.md
Last active Dec 7, 2019
Job queues in Golang
View golang_job_queue.md
@jlongster
jlongster / immutable-libraries.md
Last active Dec 4, 2019
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

@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"
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active Dec 1, 2019
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)
#
@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.

@TRPB
TRPB / arch-macbook2018.md
Last active Dec 9, 2019
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
You can’t perform that action at this time.