Skip to content

Instantly share code, notes, and snippets.

Daniel Oaks DanielOaks

Block or report user

Report or block DanielOaks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DanielOaks / UserscriptCompatability.js
Created Oct 27, 2012
Allows userscript files to work both as Greasemonkey scripts, and as BabelExt extensions
View UserscriptCompatability.js
// Basically, dynamically selects between BabelExt and Greasemonkey methods,
// depending on what is avalaible at runtime
// Simply put this at the top of your userscript, and use BE_set/getValue
// exactly as you would
// However, there is also another argument passed to getValue, def, as in the
// default value if none can be retrieved (as in Greasemonkey's GM_getValue)
function BE_setValue(key, val, callback) {
DanielOaks / Python-formatstrings.tmLanguage.diff
Created Jan 15, 2013
Sublime Text 2 Python format string syntax highlighting, Python.tmLanguage diff
View Python-formatstrings.tmLanguage.diff
--- Python.tmLanguage
+++ Python-formatstrings.tmLanguage
@@ -1171,7 +1171,7 @@
- <string>(?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%])</string>
+ <string>(?i:%(\([a-z_]+\))?#?0?\-?[ ]?\+?([0-9]*|\*)(\.([0-9]*|\*))?[hL]?[a-z%])|(?&lt;=[({{)+]|[^{])({[0-9a-zA-Z]*(\.[0-9a-zA-Z]*)?(\[([^\])]*)\])?(![rsa])?(:)?})(?=(}})+|[^}])</string>
DanielOaks / gist:4754185
Last active Dec 12, 2015
Bitbucket issue conversion, fix for new everything
View gist:4754185
#!usr/bin/env python2
# -*- coding: utf-8 -*-
## And this is the modified Bitbucket library I use. I have to bundle this, because the actual one is broken
# -*- coding: utf-8 -*-
# git+git://
__all__ = ['Bitbucket', ]
DanielOaks / .tmux.conf
Last active Dec 13, 2015
My tmux config file, might be useful to some other people
View .tmux.conf
set -g default-terminal "screen-256color"
# Status bar can have utf-8~
set-option -g status-utf8 on
# Status bar has a dim gray background
set-option -g status-bg "#303030"
set-option -g status-fg "#f0f0f0"
DanielOaks / m_fuzz.c
Last active Dec 17, 2015
ircfuzz for Plexus3, mostly for fun
View m_fuzz.c
* IRC - Internet Relay Chat,
* Copyright (C) 2001 Hybrid Development Team
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful,
DanielOaks / particles.cpp
Last active Dec 18, 2015
OpenGL 2/3d particle test. First time doing anything in C/C++ for years, beware
View particles.cpp
// First (proper) try at OpenGL programming, and first bit of C-like stuff
// for years, besides a quick dabble in C# ; caveat emptor
// Daniel Oaks 2013, public domain etc
// g++ -Wall -L/usr/lib -lGL -lGLU -lglut --std=c++11 particles.cpp -o particles
#include <stdio.h>
#include <stdlib.h>
#include <random>
#include <functional>
DanielOaks /
Last active Dec 22, 2015
Like Ponypipe, but faster
#!/usr/bin/env perl
# Dashpipe -- Hopefully a kinda faster, less fully-featured ponypipe.
# Copyright (c) 2013, Daniel Oaks, under 2-clause BSD license.
# the base regex list is from Ponypipe:
use strict ;
use utf8 ; # we like utf8
use constant { true => 1, false => 0 } ; # I think these make sense, syntactically
#!/usr/bin/env python3
# ZNC log unifier
# assumes all the logs are in folder 'log'
# and all files are output to folder 'outlog'
# This basically changes all the logs like:
# log/danneh_rizon_#chan_20142304.log
# log/danneh_rizon_#chan_20142305.log
# log/danneh_rizon_#chan_20142306.log
# to:
DanielOaks /
Last active Sep 11, 2017
Adds barcodes to Reckon item IIF lists
#!/usr/bin/env python2
# Reckon IIF item list barcode adder
# written by Daniel Oaks <>
# licensed under the BSD 2-clause license
# This basically reads through each item in your item IIF, to see if it has a barcode
# if it doesn't have a barcode and the item name contains a digit, it makes the barcode the same
DanielOaks /
Created Apr 16, 2014
Adds the correct extension to a provided library path
# platform library extension adder for Python or something
import os
import sys
'windows': 'dll',
'darwin': 'dylib',
'linux': 'so',
You can’t perform that action at this time.