Skip to content

Instantly share code, notes, and snippets.

View drouarb's full-sized avatar

DROUARD Benjamin drouarb

View GitHub Profile
@beldaz
beldaz / PDFTableStripper.java
Created October 14, 2017 22:09
Class to extract tabular PDF text using PDFBox
/*
* Copyright 2017 Beldaz (https://github.com/beldaz)
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@ruaridhw
ruaridhw / install-mono-3_12.sh
Last active April 7, 2018 20:22
A very ugly line of code to downgrade mono to v3.12
apt-get install -y --allow-downgrades --allow-unauthenticated libgdiplus libglade2.0-cil=2.12.26-0xamarin1 libglib2.0-dev libglib2.0-cil=2.12.26-0xamarin1 libgtk2.0-cil=2.12.26-0xamarin1 libjavascriptcoregtk-1.0-0 libmono-2.0-1=3.12.1-0xamarin1 libmono-2.0-dev=3.12.1-0xamarin1 libmono-accessibility4.0-cil=3.12.1-0xamarin1 libmono-cairo4.0-cil=3.12.1-0xamarin1 libmono-cecil-private-cil=3.12.1-0xamarin1 libmono-cil-dev=3.12.1-0xamarin1 libmono-codecontracts4.0-cil=3.12.1-0xamarin1 libmono-compilerservices-symbolwriter4.0-cil=3.12.1-0xamarin1 libmono-cscompmgd0.0-cil=3.12.1-0xamarin1 libmono-csharp4.0c-cil=3.12.1-0xamarin1 libmono-custommarshalers4.0-cil libmono-data-tds4.0-cil=3.12.1-0xamarin1 libmono-db2-1.0-cil=3.12.1-0xamarin1 libmono-debugger-soft4.0a-cil=3.12.1-0xamarin1 libmono-http4.0-cil=3.12.1-0xamarin1 libmono-ldap4.0-cil=3.12.1-0xamarin1 libmono-management4.0-cil=3.12.1-0xamarin1 libmono-messaging-rabbitmq4.0-cil=3.12.1-0xamarin1 libmono-messaging4.0-cil=3.12.1-0xamarin1 libmono-microsoft-build-engin
@dholroyd
dholroyd / sqlite-dump.stp
Last active November 28, 2018 00:29
systemtap script to dump sqlite statements as they are executed
/*
* Dump sqlite statements as they are executed. Tested with sqlite 3.6.20
*
* Prereqs:
* sudo yum install systemtap-client systemtap-devel kernel-devel gcc yum-utils
* sudo debuginfo-install sqlite
*
* Running:
* sudo stap -DMAXUPROBES=800 sqlite-dump.stp
*
@p2004a
p2004a / defer.cpp
Last active October 17, 2025 07:28
Simple defer macro for c++
// SPDX-FileCopyrightText: 2015 Marek Rusinowski
// SPDX-License-Identifier: MIT
#include <memory>
#include <cstdio>
template<typename F>
class defer_finalizer {
F f;
bool moved;
public:
@totherik
totherik / gist:3a4432f26eea1224ceeb
Last active March 15, 2025 06:06
v8 --allow-natives-syntax RuntimeFunctions
Per https://code.google.com/p/v8/codesearch#v8/trunk/src/runtime.cc
%CreateSymbol
%CreatePrivateSymbol
%CreateGlobalPrivateSymbol
%NewSymbolWrapper
%SymbolDescription
%SymbolRegistry
%SymbolIsPrivate
@EmmanuelKasper
EmmanuelKasper / kvm-autostable
Last active February 21, 2018 09:28
A script to automatically install Debian Wheezy on a KVM guest
#!/bin/sh
# You can optionally connect to the VM with
# virt-viewer -c qemu:///system Debian7
export OS=Debian7
virt-install \
--connect qemu:///system \
--name ${OS} \
--ram 1024 \
--vcpus 1 \