Skip to content

Instantly share code, notes, and snippets.

View luser's full-sized avatar

Ted Mielczarek luser

View GitHub Profile
@luser
luser / textoverlay.py
Created November 20, 2015 13:27
Play a video with Gstreamer, listen on a port and overlay text recieved on that port on the video
#!/usr/bin/env python
#
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import print_function
import argparse
import codecs
import gi
@luser
luser / .gitignore
Last active September 20, 2018 18:01
Makefile stats for mozilla-central
*~
venv
@luser
luser / desktop-test-run
Last active January 6, 2016 17:11
`docker run` wrapper for running things in Taskcluster desktop-test image
#!/bin/sh
# This script configures devices+ptrace for running Firefox tests in the
# taskcluster desktop-test image locally. Run it like you would `docker run`,
# any arguments passed to the script are passed to `docker run`.
# Example:
# desktop-test-run -t -i --rm taskcluster/desktop-test:0.4.3
set -e
deviceargs=""
def get(request):
debug_id = request.get('debug_id')
debug_filename = request.get('debug_filename')
if might_be_on_msdn(debug_id, debug_filename):
symbol_from_msdn = fetch_from_msdn(debug_id, debug_filename)
if not symbol_from_msdn:
raise PageNotFound()
else:
new_s3_key = upload_to_symbols_m_o_S3(symbol_from_msd)
return PageOK(new_s3_key.absolute_url)
@luser
luser / gamepadcontrols.js
Created February 4, 2016 14:20
Hacky gamepad controls for Dungeon Decorator
var gamepadPoller = -1;
function pollGamepad() {
var gamepads = navigator.getGamepads();
// Use input from any gamepad.
for (var i=0; i<gamepads.length; i++) {
if (gamepads[i]) {
var g = gamepads[i];
// Use any button for jump.
keyPressed[32] = Array.prototype.some.call(g.buttons, function(b) {return b.pressed; });
// Assume axis 0 is left/right, 1 is up/down. Not 100% reliable!
@luser
luser / orangefactor-get-tests.py
Created February 12, 2016 21:29
Get test chunks to run for top orangefactor bugs
#!/usr/bin/env python
from __future__ import print_function
import datetime
import operator
import requests
from collections import defaultdict
@luser
luser / servo-cross-mac
Created May 26, 2016 18:29
Cross-compile Servo from Linux to OS X
#!/bin/bash
#TODO: you will need to manually get an OS X SDK.
set -e
# Install the proper Rust nightly with rustup, and add the OSX target.
rustup install nightly-`cat rust-nightly-date`
rustup override add nightly-`cat rust-nightly-date`
rustup target install x86_64-apple-darwin
@luser
luser / playground.rs
Created May 27, 2016 11:15 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::marker::PhantomData;
use std::boxed::Box;
trait Data {
fn get(&self) -> u32;
}
trait DataCreator {
fn new_data() -> Box<Data>;
}
@luser
luser / playground.rs
Last active June 10, 2016 15:16 — forked from anonymous/playground.rs
Rust enum with attached strings
use std::slice::Iter;
use std::collections::HashSet;
trait EnumValues : Sized {
fn values() -> Iter<'static, Self>;
}
macro_rules! simple_enum {
($name:ident { $(($item:ident, $repr:expr),)* }) => {
#[derive(Debug)]
@luser
luser / processed_crash_schema.json
Last active June 1, 2016 16:17 — forked from adngdb/processed_crash_schema.json
Socorro's Processed Crash Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "schema of a processed crash from Socorro",
"definitions": {
"frames": {
"type": "object",
"properties": {
"frame": {
"type": "integer",