Skip to content

Instantly share code, notes, and snippets.

View eiriklv's full-sized avatar

Eirik L. Vullum eiriklv

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
GetVladimir /
Last active June 13, 2024 12:45
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial:

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

Molin-L /
Last active February 24, 2024 21:28
Install Homebrew on Apple silicon device/M1.
# Install ARM Homebrew to /opt/homebrew
# 安装ARM版本的Homebrew 到 /opt/homebrew
mkdir /opt/homebrew
sudo chown -R $(whoami) /opt/homebrew
curl -L | tar xz --strip 1 -C /opt/homebrew
# Install x86 Homebrew
arch -x86_64 /bin/bash -c "$(curl -fsSL"
nybblr / metaproxy.js
Created October 28, 2017 18:43
Metaproxy: The proxy that doesn't do anything
/* Metaproxy
* The proxy that doesn't do anything
let target = { a: 1, b: 2, c: 3 }
let handler = new Proxy({}, {
get: (...args) => Reflect[args[1]](...args)
n1ru4l / HTTPGetRequestForQueriesInterface.js
Created May 30, 2017 14:46
import { HTTPFetchNetworkInterface, printAST } from 'apollo-client';
* Serialize a object to a query string
* @source
function serialize( obj ) {
return `?` + Object.keys(obj).map(k => k + `=` + encodeURIComponent(obj[k])).join(`&`);
jacob-beltran / requestAnimationFrame.js
Last active April 17, 2020 04:05
React Performance: requestAnimationFrame Example
// How to ensure that our animation loop ends on component unount
componentDidMount() {
componentWillUnmount() {
eiriklv / avoiding-exceptions.js
Last active February 2, 2019 12:13
Exception free JavaScript?
* Check out error handling in golang:
* Wrap an "unsafe" promise
function safePromise(promise) {
return promise
sindresorhus /
Last active February 16, 2022 07:17
Results are as expected. Async comes with a slight overhead because of the event loop, but has many other benefits. So unless you know you won't need it, go for async.

Measuring sync vs async child processes in Node.js

  • macOS 10.12.3
  • Node.js 7.4.0


const childProcess = require('child_process');
yossorion /
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

SimplGy /
Last active July 27, 2023 07:30
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
# Constants