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
--applescript | |
tell application "Safari" | |
activate | |
set google_tab to current tab of first window | |
-- google currently open in the screen | |
tell google_tab | |
do JavaScript "document.f.q.value='mac ruby'" | |
end tell | |
end tell |
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
framework 'ScriptingBridge' | |
safari = SBApplication.applicationWithBundleIdentifier('com.apple.Safari') | |
google_tab=safari.windows.first.currentTab | |
cmd="document.f.q.value='mac ruby'" | |
safari.performSelector(:"doJavaScript:in:", withObject:cmd, withObject:google_tab) |
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
copy { | |
puts "puts 'hello world'" | |
} | |
#command V | |
ep |
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
# Apple Script to open google in a new tab | |
# tell application "Safari" | |
# make new document | |
# set URL of first document to "http://www.google.com" | |
# end tell | |
# rb-appscript to do the same | |
# app("Safari").make(:new => :document) | |
# app("Safari").documents[1].URL.set("http://www.google.com") |
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 ActiveRecord | |
##idea is from lovdbyless | |
##These extensions give database specific implementations for common functions | |
module ConnectionAdaptersExt | |
module MySQL | |
def rand | |
'RANDOM()' | |
end | |
def now | |
'NOW()' |
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
>> Disease.find(2) | |
=> #<Disease id: 2, name: "MS", symptom_survey_lifespan: 30, disease_status_id: 3, key: "ms", community_manager_id: 3187, created_at: nil, updated_at: nil> | |
>> User.first | |
# => #<User id: 22, verified: true, deleted: false, created_at: "2008-07-03 13:36:57", updated_at: "2010-09-23 03:18:13", first_name: "Justin", last_name: "Smith", title: "wife", disease_id: 2, address: nil, city: "Boston", state: "MA", country: "United States", sex: nil, birth_date: nil, deceased_date: nil, permit_registry: nil, height: nil, display_height_unit: nil, display_weight_unit: nil, allows_public_view: false, lat: #<BigDecimal:1098c57d0,'0.28228671E2',18(18)>, lng: #<BigDecimal:1098c56e0,'-0.81653075E2',18(18)>, postcode: "02142", last_activity_time: "2008-07-03 13:38:10", last_update_time: nil, allows_badge: false, timezone: nil, phone: nil, messaging_privileges: nil, role_id: 5, unsubscribe_token: "21a497dae68b11780871083eddd6a3f201389bd6", welcome_message_sent_on: "2009-03-24", system_welcome_message_sent_o |
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
gem 'rdebug', '0.1', :group => :development, :require => false |
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
From bef595dbdbde5725b8d49242b10a400db38134d1 Mon Sep 17 00:00:00 2001 | |
From: Ben Zack <bzack@patientslikeme.com> | |
Date: Mon, 11 Jul 2011 15:42:24 -0400 | |
Subject: [PATCH] Added levenshtein distance for determining database name | |
from branch name | |
--- | |
Gemfile | 1 + | |
Gemfile.lock | 2 ++ | |
lib/devdb.rb | 18 ++++++++++++++++++ |
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
# thanks from: http://aaroncrane.co.uk/2009/03/git_branch_prompt/ | |
function find_git_branch { | |
local dir=. head | |
git_dir=${PWD} | |
until [ "$dir" -ef / ]; do | |
if [ -f "$dir/.git/HEAD" ]; then | |
head=$(< "$dir/.git/HEAD") | |
if [[ $head == ref:\ refs/heads/* ]]; then | |
git_branch="${head#*/*/}" | |
elif [[ $head != '' ]]; then |
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
brew install nginx |
OlderNewer