This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
// Author: Benjamin Meier ([email protected]) | |
// Date: 06/10/2013 | |
namespace ObjectPoolTester |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Levenshtein | |
{ | |
/** | |
* Calculate the Levenshtein distance between two strings. Basically, the number of | |
* changes that need to be made to convert one string into another. Very useful when | |
* determining string similarties. | |
* @param stringOne | |
* @param stringTwo | |
* @param caseSensitive Should differences in case be treated as changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Ben Meier | |
email = [email protected] | |
[alias] | |
# git ds - diff your staged changes == review before committing. | |
ds = diff --staged | |
# smarter status - include tag and branch info | |
st = status -sb | |
# I know what you did yesterday - great for follow-ups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"always_prompt_for_file_reload": false, | |
"always_show_minimap_viewport": true, | |
"animation_enabled": true, | |
"atomic_save": true, | |
"auto_find_in_selection": false, | |
"auto_match_enabled": true, | |
"bold_folder_labels": true, | |
"caret_extra_width": 1, | |
"caret_style": "phase", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
class Config(object): | |
_CONFIG_FILE = '~/.config/my_program/settings' | |
def __init__(self, custom_path=_CONFIG_FILE, auto_load=False): | |
self.loaded = False | |
self.file_path = os.path.expanduser(custom_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.uct.cs.simplify.util; | |
public class CompactBitArray | |
{ | |
private static final int INTEGER_SIZE = 32; | |
private final int bits; | |
private final long length; | |
private final int blockLength; | |
private final int blocksPerInt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This script creates a basic Python package skeleton in the given directory. | |
It also sets up pytest (with coverage). | |
""" | |
import os | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from logging import StreamHandler | |
try: | |
unicode | |
_unicode = True | |
except NameError: | |
_unicode = False | |
class ColouredStreamHandler(StreamHandler): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS Webbing</title> | |
<style type="text/css"> | |
h1, h5 { | |
font-family: Verdana; | |
} | |
</style> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Generate eskom loadshedding schedule v2 for Cape Town | |
In the following code, 'day' means the day of the month.. 1-31 | |
Author: Ben Meier | |
Date: 02/02/2015 | |
""" | |
import sys |
OlderNewer