Skip to content

Instantly share code, notes, and snippets.

import os
import sys
import re
#
# Allows user to approve sudo commands with TouchID and Apple Watch.
# This script adds the following line to /etc/pam.d/sudo:
#
# auth sufficient pam_tid.so
#
@kjs3
kjs3 / got-test.js
Created November 17, 2020 19:08
Malformed Response Failure
const got = require('got')
main()
async function main() {
const url = 'https://read.audioarchitect.co/feed/podcast'
try {
console.log('getting: ', url)
const res = await got(url)
@kjs3
kjs3 / kmonad-das.kbd
Created March 1, 2020 02:02
Kmonad config for Das 4 Pro for Mac
// Kmonad config for Das Mac keyboard - https://www.daskeyboard.com/daskeyboard-4-professional-for-mac/
INPUT = LINUX_DEVICE L64 /dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd
OUTPUT = UINPUT_SINK
// Source codes
SRC
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15
grv 1 2 3 4 5 6 7 8 9 0 - = bspc home pgup numlock kpslash kpasterisk kpminus
tab q w e r t y u i o p [ ] \ del end pgdn kp7 kp8 kp9 kpplus
@kjs3
kjs3 / md-link-processing.md
Last active August 14, 2017 20:44
Markdown link processing
@kjs3
kjs3 / git-setup.sh
Created January 20, 2017 18:26
Git Setup
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global push.default current
@kjs3
kjs3 / Preferences.sublime-settings
Created January 19, 2017 05:43
Sublime Text 3 Settings
{
"file_exclude_patterns": [
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",

Slack, please for the love of God stop ingesting my gists as snippets.

@kjs3
kjs3 / module-testing.js
Last active July 6, 2016 21:26
Babel rewire and expect.js testing
// my-module.js
function privateFunc () {
console.log("Some convoluted logic.")
return 1 + 2
}
export default function () {
console.log("Hey! I'm the public interface for this module")
@kjs3
kjs3 / server.js
Created December 3, 2015 20:26
Reloading express routes/middleware on file change WITHOUT restarting node process.
if ( process.env.NODE_ENV === 'production' ) {
// dev runs with babel-node so this isn't necessary
require('babel-core/register'); // this includes the polyfill
require('newrelic');
}
import 'source-map-support/register'
import Debug from 'debug'
import express from 'express'
@kjs3
kjs3 / gist:047c1a2467a6d62bf223
Created June 16, 2015 03:19
Trying to set Parse User ACL
var user = new Parse.User({
name: name,
username: email,
email: email,
password: password
});
user.signUp().then(
function() {
var user = Parse.User.current();