This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[guid]::newguid() | set-clipboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix search quicklisp | |
nix-env -i lisp-quicklisp | |
quicklisp init | |
quicklisp run | |
quicklisp install alexandria | |
quicklisp update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spawn = require('child_process').spawn; | |
const fs = require('fs'); | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To place in ~/.config/termite/config | |
[options] | |
resize_grip = false | |
scroll_on_output = false | |
scroll_on_keystroke = true | |
audible_bell = false | |
visible_bell = false | |
mouse_autohide = false | |
allow_bold = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_ssh_agent_if_not_running () { | |
local SSH_ENVIRONMENT_FILE=~/.ssh/environment | |
if [ -f "$SSH_ENVIRONMENT_FILE" ]; then | |
source "$SSH_ENVIRONMENT_FILE" | |
fi | |
echo SSH_AGENT_PID='"'${SSH_AGENT_PID}'"' | |
if [ ! -z ${SSH_AGENT_PID} ] && ps -p ${SSH_AGENT_PID} > /dev/null | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
brightness_file=/sys/class/backlight/acpi_video0/actual_brightness | |
set_brightness () { | |
nvidia-settings -n -a BacklightBrightness=$(cat $brightness_file) > /dev/null | |
} | |
watch () { | |
inotifywait -m -e modify $brightness_file | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import http.client | |
import json | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print("USAGE: gist.py gist-id") | |
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun slime-eval-save-output (string) | |
"Evaluate STRING in Lisp and save the result in the kill ring." | |
(slime-eval-async `(swank:eval-and-grab-output ,string) | |
(lambda (result) | |
(cl-destructuring-bind (output value) result | |
(kill-new output) | |
(message "Evaluation finished; pushed output to kill ring."))))) | |
(defun lisp-eval-defun-in-kill-ring () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun replace-prefix-if-present (string prefix new-prefix) | |
"If STRING starts with PREFIX, replace the PREFIX by NEW-PREFIX. | |
Else, returns NIL." | |
(if (string-prefix-p prefix string) | |
(concat new-prefix (substring string (length prefix))) | |
nil)) |