Skip to content

Instantly share code, notes, and snippets.

View NQNStudios's full-sized avatar

Nat Quayle Nelson NQNStudios

View GitHub Profile
@NQNStudios
NQNStudios / CapsLock.ahk
Created September 20, 2014 14:53
Remaps the Caps Lock key to Escape.
CapsLock::ESC
@NQNStudios
NQNStudios / capture
Last active August 29, 2015 14:07
Contains helpful functions for using mencoder and Scrot on Linux for creating time lapses.
#!/bin/bash
# First argument: delay between time lapse screenshots (in seconds). Default=3
DELAY=${1:-"3"}
echo "Press Ctrl+C to stop capturing time lapse screenshots."
while [ 1 ]; do
scrot -q 100 "$(date +%Y%m%d%H%M%S).jpg"
sleep $DELAY
@NQNStudios
NQNStudios / install-vimfiles
Last active September 14, 2015 17:35
Uses Git/Bash commands to install my personal Vim configuration from the vimfiles repository.
#!/bin/bash
# optional first argument is the directory to place the configuration files
VIMDIR=${1:-".vim"}
# clone vimfiles repository in home directory
cd ~/
git clone git@github.com:Natman64/vimfiles.git
mv vimfiles ${VIMDIR}
@NQNStudios
NQNStudios / install-gist-scripts
Last active July 21, 2019 15:59
Manages executable scripts stored in Gists for use on Unix systems.
#!/bin/bash
# First argument: the ID of the Github Gist to clone from
GIST_ID=${1}
# Clone the gist in our bin directory
cd ~/bin
git clone git@gist.github.com:/${GIST_ID}.git
# symlink all scripts for global execution
@NQNStudios
NQNStudios / _StartupScripts_
Last active August 29, 2015 14:08
Scripts run on startup to customize my Xubuntu environment.
Scripts run on startup to customize my Xubuntu environment.
@NQNStudios
NQNStudios / inputrc
Created November 29, 2014 18:54
This is my personal Linux terminal input configuration file. To use, copy its contents into the file ~/.inputrc
set editing-mode vi
set keymap vi-command
@NQNStudios
NQNStudios / dice
Last active August 29, 2015 14:13
A simple dice roller written in Python.
#! /usr/bin/env python3
import re
import random
import unittest
exit_commands = ( "quit", "exit", "stop" )
modifier_pattern = """
\s* # white space allowed between dice expression and modifier
@NQNStudios
NQNStudios / stream-audio
Last active August 29, 2015 14:18
This script uses PulseAudio commands to create a unified audio stream for microphone and system sounds, for live streaming.
# create a virtual sink for both audio streams
SINK_ID=$(pactl load-module module-null-sink sink_name=StreamAudio sink_properties=device.description=StreamAudio)
# find microphone source ID
MIC_ID=$(pactl list short sources | grep "Snowball" | cut -f1)
# loop microphone to the new sink
MIC_LOOPBACK_ID=$(pactl load-module module-loopback sink=StreamAudio source=$MIC_ID)
# find stereo monitor ID
#! /bin/bash
cd /Applications/PICO-8.app/Contents/MacOS
./pico8 "$@"
#! /bin/bash
# Syntax: interval-screenshots [interval (seconds)]
# Takes screenshots periodically and saves them to the current directory
while [ 1 ];
do
vardate=$(date +%d\-%m\-%Y\_%H.%M.%S)
screencapture -t jpg -x ./$vardate.jpg
sleep $1;