Skip to content

Instantly share code, notes, and snippets.

View jpauwels's full-sized avatar

Johan Pauwels jpauwels

View GitHub Profile
@jstn
jstn / Timer.swift
Last active June 19, 2022 15:14
simple nanosecond timer using mach_absolute_time
/*
var t = Timer()
t.start()
// do something
t.stop()
print("took \(t.seconds)")
*/
@markandrewj
markandrewj / tmux.conf
Last active April 9, 2024 01:56
Basic Tmux Status Bar
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows
@jedi4ever
jedi4ever / gist:7677d62f1414c28a1a8c
Last active November 20, 2020 07:28
Some notes on travisci remote debugging via ssh or screenshot or remote desktop of Mac VM builds
Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build.
#################################################
# Enable remote ssh access to travisci build for debugging
#################################################
# Add a key so we can login to travisci vm
- cat ssh/travisci.pub >> ~/.ssh/authorized_keys
- chmod 600 ssh/travisci
# Install netcat
@joferkington
joferkington / point_drag_add_delete.py
Created March 26, 2015 13:46
General example of the type of framework you need to efficiently implement drawable/draggable/deleteable artists in matplotlib.
import numpy as np
import matplotlib.pyplot as plt
class DrawDragPoints(object):
"""
Demonstrates a basic example of the "scaffolding" you need to efficiently
blit drawable/draggable/deleteable artists on top of a background.
"""
def __init__(self):
self.fig, self.ax = self.setup_axes()
@johnhany97
johnhany97 / gist:2e667d3a54b45b178aad
Created April 23, 2015 00:31
Batch Replace specific text in PDF automatically using pdftk
Create a file with this:
#!/bin/bash
oldtext=$1
newtext=$2
pdffile=$3
cp $pdffile $pdffile.bak
pdftk $pdffile output $pdffile.tmp uncompress
@imneme
imneme / randutils.hpp
Last active June 9, 2025 09:24
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@GOFAI
GOFAI / deepcl.rb
Created November 22, 2015 03:13
Finalized Homebrew Formula for DeepCL
class Deepcl < Formula
desc "OpenCL library to train deep convolutional neural networks"
homepage "https://github.com/hughperkins/DeepCL"
url "https://github.com/hughperkins/DeepCL/archive/v8.1.3.tar.gz"
sha256 "e0301ba5ae4464ae27a3ec2c777b77faa90b9ee6d1059b200f06a9100d182de1"
resource "EasyCL" do
url "https://github.com/hughperkins/EasyCL/archive/b9023cdf25c10524ad06227275d3756bbe0c0ed2.tar.gz"
sha256 "96c6061385e850081cfce17673353b41dbf470fc6b6f3a15e047b1d6506ba80e"
end
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active February 4, 2025 00:47
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@marians
marians / CouchDB_Python.md
Last active June 14, 2025 02:00
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

# Example animations using matplotlib's FuncAnimation
# Ken Hughes. 18 June 2016.
# For more detail, see
# https://brushingupscience.wordpress.com/2016/06/21/matplotlib-animations-the-easy-way/
# Examples include
# - line plot
# - pcolor plot
# - scatter plot