Skip to content

Instantly share code, notes, and snippets.

@barraIhsan
barraIhsan / 8BitDoUltimate2Wireless.md
Last active November 20, 2026 18:30
8BitDo Ultimate 2 Wireless on GNU/Linux, SteamOS, and Windows

Most of the source comes from: Steam Beta Forum

Thank you so much to everyone in the forum for contributing, for reaching out to 8BitDo to request switching between XInput/DInput/Switch mode on the dongle, to Valve for adding support on DInput mode, to the SDL developers (and 8bitdo) for adding support on DInput mode, and finally, to the Linux kernel developers for adding support on XInput mode.

This gist summarizes everything from that forum.

Switching Mode

So after the latest firmware update (as the time of writing: Controller 1.06, Adapter 1.04), its now possible to switch to DInput and Switch mode by holding B (DInput) or Y (Switch) while turning on t

@bgamari
bgamari / packet-iscsi.nix
Last active December 13, 2024 13:07
A NixOS module for using Packet's iSCSI-based block storage infrastructure.
{ pkgs, config, lib, ... }:
let
packet-block-storage =
pkgs.stdenv.mkDerivation {
name = "packet-block-storage";
src = pkgs.fetchFromGitHub {
owner = "packethost";
repo = "packet-block-storage";
rev = "4be27cbca7a924b4de7af059d5ac30c2aa5c9e6f";

Language basics

let is just an expression and akin to a function!

let greeting = hello
let greeting = "hi"; /* shadowed */
let scoped = {
@benjaminoakes
benjaminoakes / errors.txt
Created July 28, 2017 16:31
BeOS (NetPositive) haiku error messages
Not a pretty sight
When the web dies screaming loud
The site is not found.
Morning and sorrow
404 not with us now
Lost to paradise.
@ChrisPenner
ChrisPenner / Tape.lhs
Last active January 1, 2023 13:09
Building up Zippers from Distributive, Representable, and Cofree
We're going to take a look at an alternative way to define a Zipper Comonad
over a data type. Typically one would define a Zipper Comonad by defining a new
datatype which represents the Zipper; then implementing `duplicate` and
`extract` for it. `extract` is typically straightforward to write, but I've had
some serious trouble writing `duplicate` for some more complex data-types like
trees.
We're looking at a different way of building a zipper, The advantages of this
method are that we can build it up out of smaller instances piece by piece.
Each piece is a easier to write, and we also gain several utility functions
@obfusk
obfusk / custom.xml
Created September 22, 2016 02:09
kodi key binding (ctrl-l) for AudioNextLanguage; copy file to ~/.kodi/userdata/keymaps/
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<FullscreenVideo>
<keyboard>
<l mod="ctrl">AudioNextLanguage</l>
</keyboard>
</FullscreenVideo>
<VideoMenu>
<keyboard>
<l mod="ctrl">AudioNextLanguage</l>
@graceavery
graceavery / harryPotterAliases
Last active February 6, 2026 23:09
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@mildmojo
mildmojo / rotate_desktop.sh
Created June 18, 2014 06:47
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@jhs
jhs / example.js
Created December 10, 2012 03:16
My Node.js modules these days
// Short module explanation // Something to gather my thoughts
// // I think this looks cool.
//
module.exports = the_exported_function // Modules are a function. Always.
//
module.exports.extra = extra // Additional API entry points if
module.exports.other = other // desired.
//
var util = require('util') // Other packages from npm or core
var assert = require('assert') // No comma-first due to lots of
@gwash
gwash / tabcloseduplicates.penta
Created October 8, 2012 08:44
pentadactyl command to close duplicate tabs
com -d "Delete duplicate tabs" tabcloseduplicates,tabclosed -js let seen={},vtabs=tabs.visibleTabs,i=vtabs.length;while(i--){let loc=vtabs[i].linkedBrowser.contentDocument.location.href||"";if(Object.prototype.hasOwnProperty.call(seen, loc)){config.tabbrowser.removeTab(vtabs[i]);}else{seen[loc]=true;}}