Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
console.log('head')
</script>
@alexburner
alexburner / patch-edid.md
Created December 23, 2020 21:23 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

  • support missing day sections (for extreme latitudes)
  • add location picker component (print, detect, search, map)
  • add dark theme for sundown
  • s/Daylight/GitHub/
  • mobile controls for date change
  • mouse controls for date change?
    • drag "now" to set time
    • ff/rr buttons for step 1, 7 days << < > >> next to top date text
  • drag orthoganal to color stripes to move toward darkest/lightest day
@alexburner
alexburner / gist:353cc56a358b493cf24b755e5628664a
Created July 17, 2018 23:42 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@alexburner
alexburner / xor.ts
Last active February 1, 2018 06:50
Object list XOR
// Find the difference between two lists of objects
const xor = <T>(
listA: T[],
listB: T[],
keys: (keyof T)[] // which obj keys to use for uniqueness check
): T[] => {
// el -> string (for map key)
const stringify = el => keys.reduce((str, key) => str + el[key], '')
@alexburner
alexburner / depot-ui.sublime-project.json
Created November 9, 2017 18:29
depot-ui.sublime-project
{
"folders": [
{
"path": "/home/alexb/depot-ui"
}
],
"settings": {
"js_prettier": {
"debug": false,
"prettier_cli_path": "/home/alexb/depot-ui/node_modules/.bin/prettier",
@alexburner
alexburner / finally.js
Last active February 1, 2018 20:55
.then() can be used as a .finally() if chained after a .catch()
new Promise((resolve, reject) => setTimeout(() => resolve('yay'), 100))
.then(val => console.log(val)) // yay
.catch(err => console.error(err)) // (never hit)
.then(() => console.log('finally 1'));
new Promise((resolve, reject) => setTimeout(() => reject('nay'), 200))
.then(val => console.log(val)) // (never hit)
.catch(err => console.error(err)) // nay
.then(() => console.log('finally 2'));
@alexburner
alexburner / user-settings.json
Created September 5, 2017 01:14
Home sublime text 3 settings (Sep 4 2017)
{
"caret_extra_width": 1,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Oceanic Next (SL).tmTheme",
"copy_with_empty_selection": false,
"drag_text": false,
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": false,
"font_face": "Source Code Pro",
"font_options":
// varyd/Math.js
export function lerp(min, max, val) { /*...*/ }
export function etc(yes, no, maybe) { /*...*/ }
export function coinFlip() { /*...*/ }
// varyd/geom.js
export function thing(vector, angle) { /*...*/ }
export function thang(voctor, dangle) { /*...*/ }
// varyd/index.js
// ActivityMapFrame.tsx
componentWillReceiveProps(nextProps: Props) {
// Destroy & re-create with config opts if they've changed
if (this.props.is3D !== nextProps.is3D) {
this.map.destroy();
this.loadMap(nextProps);
return;
}
// Update edges/devices if they've changed