Skip to content

Instantly share code, notes, and snippets.

View thegallagher's full-sized avatar

David Gallagher thegallagher

View GitHub Profile
@thegallagher
thegallagher / fixsitemanager.php
Created August 24, 2011 02:49
Filezilla site manager duplicates remover.
<?php
/*
* Filezilla site manager duplicates remover.
* Please backup your sitemanager.xml file before using.
*/
// OPTIONS: change here as required.
define('OUTPUT_XML', true); // If set to true then output the browser, otherwise false to save directly back to the file.
@pylover
pylover / a2dp.py
Last active July 21, 2025 21:07
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@evanw
evanw / 0_stackify.ts
Last active June 28, 2025 01:14
Example "stackify" algorithm for turning SSA into WASM
// This code demonstrates a simplified "stackification" algorithm to turn
// instructions in a basic block back into a tree. This is useful when
// generating WebAssembly code from assembly instructions in SSA form.
//
// It's the algorithm used by LLVM's WebAssembly backend, viewable here:
// https://github.com/llvm-mirror/llvm/blob/master/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
type InsKind =
'Add' |
'LocalSet' |