Skip to content

Instantly share code, notes, and snippets.

View wmanley's full-sized avatar

William Manley wmanley

  • stb-tester.com
  • London
View GitHub Profile
@wmanley
wmanley / Incremental ostree deploy notes.md
Last active December 29, 2016 01:09
Incremental ostree deploy notes

How does ostree admin deploy work?

src/ostree/ot-admin-builtin-deploy.c

ostree_sysroot_deploy_tree (sysroot,
                            opt_osname, revision, origin,
                            merge_deployment, kargs_strv,
                            &new_deployment,
                            cancellable, error)
#!/usr/bin/python
import argparse
import errno
import json
import os
import shutil
import subprocess
import sys
import tempfile
@wmanley
wmanley / client.vala
Created October 24, 2014 11:41
PulseVideo from GStreamer Conference 2014 lightning talk [Zero copy video with file descriptor passing](http://gstconf.ubicast.tv/videos/zero-copy-video-with-file-descriptor-passing/)
[DBus (name = "com.example.VideoSource")]
interface VideoSource : GLib.Object {
public abstract string caps { owned get; }
public abstract GLib.UnixInputStream attach () throws Error;
}
void run() throws Error
{
VideoSource demo = Bus.get_proxy_sync (
@wmanley
wmanley / tesseract-svn-cvs-to-git.sh
Created February 25, 2014 16:58
Script used to create git mirror of [tesseract SVN from googlecode](https://code.google.com/p/tesseract-ocr/) with history from [tesseract CVS from sourceforge](http://sourceforge.net/projects/tesseract-ocr/) included.
#!/bin/sh
git svn clone -s --prefix=googlecode/ http://tesseract-ocr.googlecode.com/svn tesseract-svn
rsync -av tesseract-ocr.cvs.sourceforge.net::cvsroot/tesseract-ocr/tesseract/ cvs-clone/
git init tesseract-cvs --bare
(cd cvs-clone && find . -name '*,v' -print | cvs-fast-export -k | sed 's/.gitignore/.cvsignore/g') | (cd tesseract-cvs && git fast-import)
cd tesseract-svn
svn_import_sha=$(git log --grep 'trunk@4 ' --oneline | cut -f1 -d' ')
git fetch ../tesseract-cvs
@wmanley
wmanley / README.md
Created February 6, 2013 09:46
A code sketch of generated C++ code from SQLite SQL with the aim of being able to edit the SQL with a generated program to check ABI compatibility.

Goals:

  • Minimal dependencies
  • Complementary to sqlite C API, rather than a wrapper for it
  • Provides type safety
  • SQL must be modifiable later
  • It should be easy to check that ABI hasn't broken
@wmanley
wmanley / econtext.cpp
Last active December 12, 2015 02:18
Code sketch of a mechanism for attaching additional context to exceptions
#include "econtext.h"
__thread std::vector<ExceptionContextItem> currentContext;
typedef void (*cxa_throw_type)(void *, void *, void (*) (void *));
static cxa_throw_type orig_cxa_throw = 0;
static void load_orig_throw_code()
{
orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw");