Skip to content

Instantly share code, notes, and snippets.

View danudey's full-sized avatar
🐪

Daniel Fox danudey

🐪
View GitHub Profile
@danudey
danudey / custom.vimrc
Created December 8, 2015 22:53
A simple custom vimrc
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set smartcase " Do smart case matching
set incsearch " Incremental search
set mouse=a " Enable mouse usage (all modes)
set encoding=utf-8 " Set default file encoding
syntax on " Enable syntax highlighting
filetype plugin indent on " When loading a syntax plugin, load filetype indent rules
" These are default on our servers but not necessarily elsewhere
#!/usr/bin/env python
from __future__ import division
import random
class Die(object):
"""The Gambler's Fallacy made manifest"""
def __init__(self, size):
self.size = size
self.state = [1 for i in xrange(size)]
@danudey
danudey / pythonsizes.py
Created July 11, 2019 18:43
An ugly little script to test the affect of various object allocation 'strategies' in Python
#!/usr/bin/env python
import sys
import time
from random import randint
import gc
import subprocess
import os
@danudey
danudey / update_classpath.groovy
Created January 4, 2021 22:58
How to use the Jenkins script console to add jars to your classpath without reloading
// Import a class from outside of Jenkins, so that we can get
// The external class loader being used. In our case, we're using
// a class from the MySQL Connector/J library, which we have in
// file:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
import com.mysql.jdbc.Util
// Get a reference to the global class laoder that was used
/// for that class
def loader = Util.class.getClassLoader()