Skip to content

Instantly share code, notes, and snippets.

View jasonwhite's full-sized avatar

Jason White jasonwhite

  • Greater Seattle Area
View GitHub Profile
View reddit-wallpaper.py
#!/usr/bin/env python3
"""
Uses the Reddit API to get the top wallpaper from a specified subreddit.
"""
import urllib.request
import json
import subprocess
import shutil
@jasonwhite
jasonwhite / syscalls.json
Created June 4, 2020 17:35
x64 syscalls
View syscalls.json
[
{
"num": 0,
"name": "sys_read",
"params": [
[
"unsigned int",
"fd"
],
[
@jasonwhite
jasonwhite / stremio.nix
Created May 10, 2020 22:20
NixOS build for Stremio
View stremio.nix
{
pkgs ? import <nixpkgs> {},
}:
with pkgs;
with builtins;
let
serverJS = fetchurl {
url = "https://s3-eu-west-1.amazonaws.com/stremio-artifacts/four/master/server.js";
@jasonwhite
jasonwhite / pulsetest.cc
Last active October 22, 2023 02:02
A simple PulseAudio test program for monitoring volume changes on the default sound sink.
View pulsetest.cc
/**
* Author: Jason White
* License: Public Domain
*
* Description:
* This is a simple test program to hook into PulseAudio volume change
* notifications. It was created for the possibility of having an automatically
* updating volume widget in a tiling window manager status bar.
*
* Compiling:
@jasonwhite
jasonwhite / joystick.c
Last active November 20, 2023 07:35
Reads joystick/gamepad events on Linux and displays them.
View joystick.c
/**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
@jasonwhite
jasonwhite / filemonitor.c
Created November 13, 2014 01:54
Windows file monitoring implemented in C and D.
View filemonitor.c
/*
* This is a short test program that prints a message when a file is added,
* removed, modified, or moved from any directory below that of the program's
* working directory.
*/
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <tchar.h>
#include <stdint.h>
@jasonwhite
jasonwhite / desktopogra.py
Created November 11, 2014 06:38
Downloads all wallpapers from the Desktopography exhibitions.
View desktopogra.py
#!/usr/bin/python3
"""
Desktopography provides no way of downloading all of their wallpapers at once.
This script will scrape the Desktopography website and download all of the
wallpapers for the specified resolutions and years. Wallpapers that have already
been downloaded are skipped.
Usage: ./desktopogra.py [DIR]
The wallpapers are saved in the following format:
@jasonwhite
jasonwhite / vlcopen.sh
Last active December 25, 2016 16:22
Opens a youtube-dl supported video URL in your clipboard in VLC (or another video player).
View vlcopen.sh
#!/bin/bash
# Opens the video on your clipboard and plays it in VLC. I recommend binding
# this to a keyboard shortcut.
#
# This script is based on:
# https://gist.github.com/swarminglogic/0cd2f6d55390243e693b
#
# Usage: vlcopen.sh
#