Skip to content

Instantly share code, notes, and snippets.

View chrisallenlane's full-sized avatar

Chris Allen Lane chrisallenlane

View GitHub Profile
@chrisallenlane
chrisallenlane / suppress.sh
Created October 21, 2020 23:04
PulseAudio: enable noise suppression on microphone
#!/bin/bash
# This creates a noise-suppressed monitor of the Yeti Nano
# see: https://unix.stackexchange.com/a/579680/44856
# see: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index45h3
##
# To view available sources:
# pactl list sources short
@chrisallenlane
chrisallenlane / .luacheckrc
Created September 22, 2020 22:14
.luacheckrc file for Pico-8 development
-- A `.luacheckrc` file for Pico-8 development.
-- Pico-8: https://www.lexaloffle.com/pico-8.php
-- Luacheck: https://luacheck.readthedocs.io/en/stable/config.html
globals = {
"_draw",
"_init",
"_update",
"abs",
"add",
@chrisallenlane
chrisallenlane / encodings-all.txt
Created January 14, 2019 16:56
cheat cheatsheet encodings
This is the output of:
ls | xargs file
7z: ASCII text
ab: ASCII text
alias: ASCII text
ansi: ASCII text
apk: ASCII text
apparmor: ASCII text
apt: ASCII text
@chrisallenlane
chrisallenlane / delete-outlook-webmail-inbox.js
Last active February 13, 2018 15:00
User-side script for deleting multiple pages of email in Outlook Web App.
/**
* Paste this in a browser console to automate the processes of clicking
* "Select All" and "Delete" in OWA. Useful for flushing out abandoned inboxes
* (from the user side).
*/
(function () {
document.querySelector('input[type=checkbox]').click();
document.querySelector('a#lnkHdrdelete').click();
})();
@chrisallenlane
chrisallenlane / fix-github.css
Last active February 11, 2017 14:50
Reverts changes made to header on 10 Feb 2017.
/*
Apply these rules to `github.com` via the "Stylish" Google Chrome extension:
https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en
*/
div.header.header-dark {
background-color: rgb(245, 245, 245);
}
@chrisallenlane
chrisallenlane / configure-vm-for-shapeoko.sh
Created March 11, 2016 15:03
Configures a virtual-machine to use Universal G-code Sender to control a Shapeoko 3
#!/bin/bash
# This script configures a Lubuntu 15.10-based virtual machine to use Universal
# G-code sender to communicate with a Shapeoko 3.
# Update the system dependencies
sudo apt-get update && sudo-apt-get upgrade --assume-yes
sudo apt-get autoclean && sudo apt-get autoremove
# Install the required dependencies
@chrisallenlane
chrisallenlane / progress.js
Created June 18, 2014 02:42
Console progress meter in nodejs
counter = 0;
setInterval(go, 250);
function go() {
counter++;
// This is the interesting line
process.stdout.write("Task is " + counter * 10 + "% complete.\r");
if(counter >= 10) {

Keybase proof

I hereby claim:

  • I am chrisallenlane on github.
  • I am chrisallenlane (https://keybase.io/chrisallenlane) on keybase.
  • I have a public key whose fingerprint is 7B55 E9E4 C286 BA99 AA99 1997 BC3A 2A59 8835 1AF4

To claim this, I am signing this object:

@chrisallenlane
chrisallenlane / curl-post.sh
Created April 25, 2014 16:59
Use cURL to POST data to a URL
#!/bin/sh
# specify the target URL
url="http://www.example.com"
# spoof a user-agent if you need to
userAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36"
# specify the payload data
data="id=12345"
@chrisallenlane
chrisallenlane / preload
Created March 9, 2014 19:17
Preloading
function preload(files) {
var images = [];
for (i = 0; i < files.length; i++) {
images[i] = new Image();
images[i].src = files[i];
}
}
preload([