Instantly share code, notes, and snippets.

🐘
not eaten by 🦁 yet

Jan-Erik Rediger badboy

View GitHub Profile
View badges.rb
def combine(file, background, out)
file = File.join("/data", file)
background = File.join("/data", background)
out = File.join("/data", out)
cmd = "docker run --rm -ti -v $(pwd):/data r3ddox/node-pdftk pdftk #{file} background #{background} output #{out}"
#puts "Executing: #{cmd.inspect}"
`#{cmd}`
end
def pdfmerge(files, out)
View transform-docs.rb
#!/usr/bin/env ruby
# encoding: utf-8
require 'json'
def die(msg)
$stderr.puts msg
exit 2
end
@badboy
badboy / playground.rs
Created Dec 12, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
trait StateSet {
fn next(self) -> (u32, Self);
}
trait State {
type S: StateSet;
fn next(self) -> (u32, Self::S);
}
macro_rules! delegate {
View 0001-Disable-midnight-throttling-through-a-pref.patch
From b67bab4252dd0d3c707654721509764afc8e8b54 Mon Sep 17 00:00:00 2001
From: Jan-Erik Rediger <jrediger@mozilla.com>
Date: Tue, 11 Dec 2018 00:41:36 +0100
Subject: [PATCH] Disable midnight throttling through a pref
---
toolkit/components/telemetry/app/TelemetrySend.jsm | 6 ++++++
toolkit/components/telemetry/app/TelemetryUtils.jsm | 1 +
.../tests/marionette/harness/telemetry_harness/testcase.py | 3 ++-
3 files changed, 9 insertions(+), 1 deletion(-)
View z3-example.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <z3.h>
int main(int argc, char** argv)
{
Z3_config cfg = Z3_mk_config();
Z3_context ctx = Z3_mk_context(cfg);
Z3_solver solver = Z3_mk_solver(ctx);
View z3-example.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <z3.h>
int main(int argc, char** argv)
{
Z3_config cfg = Z3_mk_config();
Z3_context ctx = Z3_mk_context(cfg);
View semver_tests.rs
#![allow(dead_code)]
#![allow(unused_variables)]
extern crate env_logger;
#[macro_use]
extern crate log;
extern crate semver;
extern crate z3;
use semver::{Version, VersionReq};
View janerik.zsh-theme
# vim: ft=sh
# via: https://github.com/mitsuhiko/dotfiles/blob/master/zsh/custom/themes/mitsuhiko.zsh-theme
setopt prompt_subst
export LSCOLORS=ExGxFxDxCxHxHxCbCeEbEb
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[blue]%}git%{$reset_color%}:"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}+"
ZSH_THEME_GIT_PROMPT_BRANCH=""
@badboy
badboy / playground.rs
Created Sep 27, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#![allow(unused)]
use std::collections::HashMap;
#[derive(Debug)]
enum Scalar {
String(String),
Unsigned(u32),
Bool(bool),
}
@badboy
badboy / playground.rs
Created Sep 27, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
use std::any::Any;
use std::any::TypeId;
#[derive(Debug)]
enum Scalar {
String(String),
Unsigned(u32),
Bool(bool),
}