- Template Method
- Strategy
- Observer
- Composite
- Iterator
- Command
- Adapter
- Proxy
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 | |
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
"/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.la" \ | |
"/usr/local/lib/libosxfuse_i64.la" \ | |
"/usr/local/lib/pkgconfig/osxfuse.pc" ) |
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
# Change service (VPN) name to the name of your configured VPN service | |
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set myConnection to the service "RentPath" | |
if myConnection is not null then | |
if current configuration of myConnection is not connected then | |
connect myConnection | |
end if | |
end if |
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/env ruby | |
require 'pry-nav' | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str | |
end | |
branch_name = `git rev-parse --abbrev-ref HEAD`.chomp |
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/env bash | |
# determine the local gateway | |
netstat -nr|grep '^default' |
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/env ruby | |
require "rubygems" | |
require "thor" | |
require 'terminal-notifier' | |
class NotifyAfter < Thor | |
desc "after ARGS", | |
"ARGS is the after and list of arguments to run, after which you will be notified." |
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 | |
cmd=$1 | |
function init_postgres() { | |
initdb /usr/local/var/postgres | |
} | |
function start_postgres() { | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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 | |
# | |
# Simple file unlocking utility for Mac OS X | |
# | |
ARGS=1 | |
E_BADARGS=65 | |
SETFILE=/Applications/Xcode.app/Contents/Developer/usr/bin/SetFile | |
function recursiveUnlock() { | |
pushd $1 |
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/env bash | |
cmd=$1 | |
function start_redis() { | |
nohup redis-server /usr/local/etc/redis.conf > /dev/null 2>&1 & | |
} | |
function stop_redis() { | |
redis-cli shutdown |
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/env bash | |
# Use curl for REST testing apis | |
# | |
# curl params: | |
# i – show response headers | |
# H – pass request headers to the resource | |
# X – pass a HTTP method name | |
# d – pass in parameters enclosed in quotes; multiple parameters are separated by ‘&’ | |
# curl -i -H "Accept: application/json" -X POST -d "firstName=james" http://192.168.0.165/persons/person |
OlderNewer