- 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
# module: sftp | |
# A generic Thor module for sftp syncing. | |
# | |
# 1. Call `thor sftp:setup` to create config file. | |
# 2. Edit the config file | |
# 3. Call `tor sftp:sync` start the sync | |
# | |
# Ze end. |
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 'vcr' | |
require 'support/integration_support' | |
VCR.config do |c| | |
c.cassette_library_dir = File.expand_path('fixtures/cassette_library') | |
c.stub_with :fakeweb | |
c.ignore_localhost = false | |
c.ignore_hosts EXCHANGE_CASE_SERVICE_INTEGRATION_HOST | |
c.default_cassette_options = { :record => :none } | |
end |
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
chef_server = "provision-dev.infra.rds" | |
log_level :info | |
log_location STDOUT | |
node_name "vagrant" | |
client_key "#{ENV['HOME']}/.chef/#{chef_server}/vagrant.pem" | |
validation_client_name "chef-validator" | |
validation_key "#{ENV['HOME']}/.chef/#{chef_server}/chef-validator.pem" | |
chef_server_url "https://#{chef_server}" | |
syntax_check_cache_path "#{ENV['HOME']}/.chef/#{chef_server}/syntax_check_cache" |
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
# Run Guard normally. This Guardfile defines 2 groups: | |
# 1) default: This is the default group and will run all appropriate specs when anything changes. | |
# 2) focus: This is the group you want when you are focusing on a specific spec or context of specs. When in this | |
# scope Guard will only run specs tagged with :focus. | |
# | |
# Example: | |
# context "GET on :index, /", focus: true do | |
# ... | |
# end | |
# |
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 String | |
class << self | |
def random(count = 6, ranges = [('a'..'z'),('A'..'Z'),('0'..'9')]) | |
o = ranges.map{|i| i.to_a}.flatten; | |
string = (0..(count-1)).map{ o[rand(o.length)] }.join; | |
end | |
end | |
def left(count) |
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 ruby | |
class String | |
ENCODING_OPTS = { invalid: :replace, undef: :replace, replace: '', universal_newline: true }.freeze | |
def remove_non_ascii | |
encode(Encoding.find('ASCII'), ENCODING_OPTS) | |
end | |
end | |
# @zsh_history = %x(cat ~/.zsh_history |sed 's/\xc2\x91\|\xc2\x92\|\xc2\xa0\|\xe2\x80\x8e//' 2> /dev/null).split("\n") |
OlderNewer