Skip to content

Instantly share code, notes, and snippets.

sudo nano /etc/modprobe.d/hid_apple.conf
comment/uncomment
options hid_apple swap_fn_leftctrl=1
reload module (must be done as one command or keyboard will be disabled)
sudo modprobe -r hid_apple; sudo modprobe hid_apple
design with engineers
- basic, no research
- scrappy, no cohesive vision
- meek, little confidence
+ actual designer
introducing a proper design practice into acompany full of engineers
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<div id="error"></div>
// main.rs
mod foo;
use foo::Bar;
fn main() {
Bar::do_a_thing();
}
@nickbrowne
nickbrowne / hoist-imports.js
Created October 4, 2018 02:18
Hoist es6 imports to top of file
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
let imports = [];
let paths = root.find(j.ImportDeclaration, {
type: "ImportDeclaration"
}).forEach((x) => imports.push(x));

A cron job to check the lid state and re-issue a suspend command.

sudo crontab -e

Add this

* * * * * /bin/bash -c 'lid_state=$(cat /proc/acpi/button/lid/LID0/state); case $lid_state in *closed*) systemctl suspend ;; esac'
@nickbrowne
nickbrowne / super.md
Created May 1, 2018 06:26
Albert and ksuperkey

Configure Albert to use Ctrl+Shift+Space to launch.

Use ksuperkey to rebind left super.

ksuperkey -e "Super_L=Shift_L|Control_L|space"
@nickbrowne
nickbrowne / pg-gem-snap.md
Created February 27, 2018 06:35
pg gem and postgres snap

Assuming postgresql10 snap installed:

bundle config build.pg --with-pg-config=postgresql10.pgconfig
bundle install

I always forget

  • Switch to tty1 (ctrl+alt+f1)
  • systemctl isolate multi-user.target to set non graphical run level
  • chmod +x and sudo ./NVidia-blahblahblah

reboot