This file contains 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/python | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Mike Shoup | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains 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
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains 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
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This file contains 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
whatismyip() { | |
IP=`curl --silent http://ip.appspot.com/` | |
echo "External IP: ${IP}" | |
} |
This file contains 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
#!/bin/bash | |
# Mac Bootstrap Script | |
# (C) 2011 - @codatory | |
# | |
# "It might work for you, too." | |
pretty_echo(){ | |
echo '--------------------------------' | |
echo " $*" |
This file contains 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
# Configuration Constants (move to yaml ?) | |
HOST = 'ad01.domain.local' | |
PORT = 636 | |
USER = 'administrator' | |
PASS = 'password' | |
BASE = 'dc=domain, dc=local' | |
DOMAIN = 'domain.local' | |
SCOPE = '(&(objectCategory=person)(objectClass=user))' | |
require 'rubygems' |
This file contains 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
# Switch me back to ^A, thanks | |
set-option -g prefix C-a | |
unbind-key C-b | |
bind-key a send-prefix | |
# I miss ^A^A and ^ASpace | |
bind-key C-a last-window | |
bind-key Space next-window | |
bind-key C-Space previous-window |
This file contains 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
# Date formats | |
Time::DATE_FORMATS.merge!( | |
:friendly_date => lambda {|d| "#{d.month}/#{d.mday}" }, # 4/25 (no leading zeroes) | |
:friendly_time => lambda {|t| | |
date = (t.at_midnight == Time.now.at_midnight) ? '' : "#{t.month}/#{t.mday}@" # 4/25@4PM on other days | |
"#{date}#{t.strftime('%I').to_i}#{t.strftime('%p')}" # 4PM on same day | |
}, | |
:year => "%Y", # 2008 | |
:month_year => "%b %Y", # Apr 2008 | |
:ampm_time => "%I:%M %p", # 04:15 PM |
This file contains 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
require 'fuzzystringmatch' | |
class Phrase | |
attr_reader :matches | |
def initialize(str, match_score=0.8) | |
@str = str | |
@matches = [] | |
@match_score = match_score | |
@scorer = FuzzyStringMatch::JaroWinkler.create |
This file contains 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
class FuzzyMatch | |
class Matcher | |
require 'singleton' | |
require 'fuzzystringmatch' | |
include Singleton | |
JW = FuzzyStringMatch::JaroWinkler.create | |
def self.get_score(str1,str2) | |
JW.getDistance(str1,str2) | |
end |