Skip to content

Instantly share code, notes, and snippets.

View vindir's full-sized avatar
馃О

Jamey Owens vindir

馃О
View GitHub Profile
@vindir
vindir / faroo.cs
Last active January 3, 2016 05:09
C# Implementation of Faroo edit distance algorithm - built around levenshtein distance algo. Source - http://blog.faroo.com/2012/06/07/improved-edit-distance-based-spelling-correction/
// SymSpell: 1000x faster through Symmetric Delete spelling correction algorithm
//
// The Symmetric Delete spelling correction algorithm reduces the complexity of edit candidate generation and dictionary lookup
// for a given Damerau-Levenshtein distance. It is three orders of magnitude faster and language independent.
// Opposite to other algorithms only deletes are required, no transposes + replaces + inserts.
// Transposes + replaces + inserts of the input term are transformed into deletes of the dictionary term.
// Replaces and inserts are expensive and language dependent: e.g. Chinese has 70,000 Unicode Han characters!
//
// Copyright (C) 2012 Wolf Garbe, FAROO Limited
// Version: 1.6
@vindir
vindir / stackedit basics
Last active January 3, 2016 05:19
Welcome document
Welcome to StackEdit! {#welcome}
=====================
Hello, I am your first Markdown document within **StackEdit**[^stackedit]. Don't delete me, I can be helpful. I can be recovered anyway in the `Utils` tab of the <i class="icon-cog"></i> `Settings` dialog.
----------
Documents
@vindir
vindir / vonage.sh
Created April 14, 2014 08:02 — forked from sulrich/vonage.sh
#!/bin/sh
#
RCFILE=$HOME/.vonage
PREFIX='1'
#if [ a$1 = a ]
#then
# printf '\n\nUsage: dial \n\n'
# exit
#fi
jowens@Amdahl-2:~/Workspace/mojolingo/repos/punchblock/lib/punchblock$ cat ~/.vimrc
" Vundle Initialization "
"""""""""""""""""""""""""
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
@vindir
vindir / .bash_logout
Last active September 8, 2016 01:38
dotfiles dump
# ~/.bash_logout -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
echo "Goodbye!"
sleep 2
if [ "$SHLVL" = 1 ] && [ -x /usr/bin/clear_console ]; then
/usr/bin/clear_console -q
else
clear
fi
@vindir
vindir / mono.rb
Created May 14, 2014 14:41 — forked from MattesGroeger/mono.rb
Brew formula for installing mono
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
url 'http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz2'
homepage 'http://www.mono-project.com/'
sha1 'e356280ae45beaac6476824d551b094cd12e03b9'
def install
#!/bin/bash
#Remove LDAP Stuff'n'Such
/etc/init.d/slapd stop
cd /usr/local/openldap/etc/openldap/
rpm -qa |grep openldap-ltb |xargs yum remove -y
rm -rf /usr/local/openldap/
#Remove python bits
pip freeze |awk -F '==' '{print $1}' |xargs pip uninstall -y
@vindir
vindir / gist:17b8c2ed3ac59f4026f1
Created October 2, 2014 20:30
subprocess examples
# Simple process Popen object
proc = subprocess.Popen([echo, '-n', my_combo_breaker], stdout=subprocess.PIPE)
# Dumping standard out to a var
#proc = subprocess.Popen([echo, '-n', my_combo_breaker], stdout=subprocess.PIPE).stdout.read().strip()
# Piping output of echo to pbcopy
#echo_out = subprocess.Popen([echo, '-n', my_combo_breaker], stdout=subprocess.PIPE)
#subprocess.Popen(['pbcopy'], stdin=echo_out)
# Doing it sensibly and just pushing stdin (broken currently)
pbcopy = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE)
pbcopy.communicate(input=my_combo_breaker)
@vindir
vindir / totprescue.py
Created November 10, 2014 18:31
Retrieve the seed and current TOTP token for any given LDAP account. Assumes LDAP is used as the auth source.
#!/usr/bin/env python
from optparse import OptionParser
import ConfigParser
import totpcgi
import totpcgi.backends
import getpass
import sys
def decrypt_user_token(backends, args):
user = args[0]