Skip to content

Instantly share code, notes, and snippets.

View ar-nelson's full-sized avatar

Adam R. Nelson ar-nelson

View GitHub Profile
@ar-nelson
ar-nelson / figma-mouse-wheel.user.js
Created August 20, 2019 17:44
Greasemonkey script to fix slow Figma mouse wheel scrolling in Firefox on Linux
// ==UserScript==
// @name Figma Mouse Wheel Speed Fix
// @namespace https://adam.nels.onl
// @match https://www.figma.com/*
// @grant none
// ==/UserScript==
// Mouse wheel scrolling in Figma on Firefox + Linux is unbearably slow.
//
// This script catches all mouse wheel events on the main canvas,
@ar-nelson
ar-nelson / SIP.hs
Last active March 21, 2022 19:31
SIP hash in pure Haskell
{-# LANGUAGE UnicodeSyntax #-}
-- SIP hash in pure Haskell
-- Original C reference implementation taken from (github.com/veorq/SipHash)
-- Translated to Haskell by Adam R. Nelson (github.com/ar-nelson)
--------------------------------------------------------------------------------
module Data.Digest.SIP(sipHash) where
import Control.Monad
@ar-nelson
ar-nelson / wmiirc.1.sh
Created September 14, 2013 20:10
Initial version of the launcher script for wmiirc.js.
#!/bin/sh
node ~/.wmii-hg/wmiirc.js
@ar-nelson
ar-nelson / wmiirc.1.js
Created September 14, 2013 20:07
Initial skeleton version of wmiirc.js, the user-modifiable configuration file for my node.js wmii config.
var dialog = require('./lib/dialog.js');
var wmii = require('./lib/wmii.js');
var wmiir = require('./lib/wmiir.js');
var modkey = 'Mod4';
var terminal = 'urxvt';
function attachModKey(mode) {
var newMode = {};
for (var key in mode) {
@ar-nelson
ar-nelson / wmii.1.js
Created September 14, 2013 18:21
Initial skeleton version of the core wmii config node.js module.
// wmii core Module
// Adam R. Nelson
// August 2013
var wmiir = require('./wmiir.js');
var events = require('./wmii_events.js');
var keys = require('./wmii_keys.js');
var dialog = require('./dialog.js');
var spawn = require('child_process').spawn;
@ar-nelson
ar-nelson / dialog.js
Created August 30, 2013 06:09
node.js module that displays Zenity dialog boxes.
// zenity dialog box functions
// Adam R. Nelson
// August 2013
var spawn = require('child_process').spawn;
function appendSettings(args, settings) {
if (settings) {
if (settings.ok) {
args.push('--ok-label');
@ar-nelson
ar-nelson / wmii_keys.js
Last active December 21, 2015 23:59
wmii keyboard events handler for node.js. Depends on wmiir.js and wmii_events.js.
// wmii keybindings and keyboard event module
// Adam R. Nelson
// August 2013
var wmiir = require('./wmiir.js');
var events = require('./wmii_events.js');
var globalKeys = {};
var modeKeys = {};
var currentMode = null;
@ar-nelson
ar-nelson / key_events.js
Created August 24, 2013 23:17
Uses wmii_events.js to listen for wmii keypress events.
var events = require('./wmii_events.js');
var stdin = process.openStdin();
events.on('Key', function(key) {
console.log('Keypress: ' + key);
});
console.log("Press ENTER to exit.");
stdin.on('data', function(data) {
@ar-nelson
ar-nelson / wmii_events.js
Last active December 21, 2015 15:59
node.js EventEmitter wrapper for the wmii event loop.
// wmii event handler module
// Adam R. Nelson
// August 2013
var events = require('events');
var util = require('util');
var wmiir = require('./wmiir.js');
function WmiiEvents() {
@ar-nelson
ar-nelson / hello.js
Created August 24, 2013 21:24
Hello, world!
console.log('Hello, world!');