Skip to content

Instantly share code, notes, and snippets.

Avatar

Ezekiel Templin ezkl

View GitHub Profile
@ezkl
ezkl / git-remote-output.md
Created Sep 27, 2011 — forked from bcg5017/new remote -v
The output of `git remote -v`
View git-remote-output.md

fetch is where you update from

git fetch origin master == fetch any updates from the remote repository called origin's master branch.

OR

git pull origin master == fetch any updates AND merge them into mine

origin	git@github.com:ezkl/code.ipsrvcs.com.git (fetch)

push is where you put your updates

View ezekiel_templin.rb
class EzekielTemplin
def initialize
@birthdate = Date.parse('1983-06-29')
@birthplace = "Saegertown, PA"
@gender = "male"
end
def age
Date.today.year - @birthdate.year
end
View local_var_overwrite_warning.rb
# Much more realistic context.
def extract_prefix_from_path(path)
/(?<prefix>.+)_path/ =~ path.to_s ? prefix : false
end
path = extract_prefix_from_path("homepath")
puts path #=> false
puts extract_prefix_from_path("home_path") #=> home
@ezkl
ezkl / incoming_calls.rake
Created Jan 11, 2012 — forked from dannymcc/incoming_calls.rake
nokogiri and mechanize
View incoming_calls.rake
desc "Import incoming calls"
task :fetch_incomingcalls => :environment do
# Logs into manage.phoneprovider.co.uk and retrieved list of incoming calls.
require 'rubygems'
require 'mechanize'
require 'logger'
# Create a new mechanize object
agent = Mechanize.new { |a| a.log = Logger.new(STDERR) }
@ezkl
ezkl / ty.rb
Created Feb 28, 2012
Typhoeus::Request shortcut
View ty.rb
require "typhoeus"
module Ty
class << self
include Typhoeus
%w(get post put delete head).each do |method|
define_method(method.to_sym) do |url, opts = {}|
Request.send(method, url, opts)
end
View Guardfile
guard 'spork', :wait => 60, :aggressive_kill => false, :notify_on_start => true do
watch('test/test_helper.rb') { :test_unit }
end
guard 'minitest', :drb => true do
watch(%r|^test/(.*)_spec\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}#{m[2]}_spec.rb" }
watch(%r|^test/test_helper\.rb|) { "test" }
end
@ezkl
ezkl / mail.diff
Created Mar 15, 2012
mail v2.3.3 v2.4.0 diff
View mail.diff
.gitignore | 2 +-
.travis.yml | 7 +
CHANGELOG.rdoc | 6 +
CONTRIBUTING.md | 45 ++
Gemfile | 10 +-
README.md | 649 ++++++++++++++++++
README.rdoc | 563 ----------------
Rakefile | 16 +-
lib/VERSION | 4 +-
lib/mail.rb | 4 +-
@ezkl
ezkl / iterm_tab.sh
Created Apr 1, 2012
Bash function to generate a new iTerm tab in the current directory
View iterm_tab.sh
function tab() {
osascript -e "
tell application \"iTerm\"
tell the first terminal
launch session \"Default Session\"
tell the last session
write text \"cd $(pwd)\"
end tell
end tell
end tell"
@ezkl
ezkl / setup_heroku_for_193.sh
Created Apr 4, 2012
Setting up Heroku environment to run Ruby 1.9.3-p125
View setup_heroku_for_193.sh
heroku labs:enable user_env_compile
heroku config:add RUBY_VERSION=ruby-1.9.3-p125
heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
@ezkl
ezkl / flashback_trojan_scan.sh
Created Apr 5, 2012
Poorly Written Flashback Trojan Scan
View flashback_trojan_scan.sh
#!/usr/bin/env bash
browser_regex='Firefox|Chrome|Safari'
infected=0
shift
echo "============================="
echo "Scanning for Flashback Trojan"
echo "============================="
echo
shopt -s nullglob
You can’t perform that action at this time.