See comments in the files for explanation. This works flawlessly for me on MediaTemple + Git(Hub).
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
http://en.wikipedia.org/wiki/Levenshtein_distance | |
[root@linux-server test]# irb | |
irb(main):001:0> | |
Create a list of values contained in an array object: | |
myList = ['ruby','sql','ruby','bash','python','perl','java','sql'] | |
=> ["ruby", "sql", "ruby", "bash", "python", "perl", "java", "sql"] |
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 'rubygems' | |
require 'freshbooks' | |
FreshBooks::Base.establish_connection('name.freshbooks.com', 'secret') | |
invoices = FreshBooks::Invoice.list | |
begin | |
invoices.to_a | |
invoices.delete_if { |invoice| invoice.status == "paid" } |
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
~/sinatra/cancuntravelnow(master) $ sudo gem update heroku | |
Updating installed gems | |
Nothing to update | |
~/sinatra/cancuntravelnow(master) $ gem list | grep heroku | |
heroku (1.3.0) | |
~/sinatra/cancuntravelnow(master) $ heroku create cancuntravelnow | |
This version of the heroku gem has been deprecated. | |
Please update it by running: gem update heroku |
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
def create | |
remote = extract_option('--remote', 'heroku') | |
name = args.shift.downcase.strip rescue nil | |
name = heroku.create(name, {}) | |
display "Created #{app_urls(name)}" | |
if remote || File.exists?(Dir.pwd + '/.git') | |
remote ||= 'heroku' | |
return if shell('git remote').split("\n").include?(remote) | |
shell "git remote add #{remote} git@#{heroku.host}:#{name}.git" | |
display "Git remote #{remote} added" |
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
before_filter :should_have_job_hunter :except => [ :index ] | |
# call to action al aplicar para que llenen el trabajo perfecto | |
def should_have_job_hunter | |
@user = User.find_by_id(current_user.id, :include => :job_hunter) | |
if @user.job_hunter==nil | |
redirect_to "/job_requests/new" | |
end | |
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
# app.rb | |
require 'rubygems' | |
require 'sinatra' | |
require 'yaml' | |
require 'wufoo' | |
config = YAML::load(File.read('config/wufoo')) | |
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
<script type="text/javascript" charset="utf-8"> | |
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { | |
if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "THE URL YOU WANT TO REDIRECT"; | |
} | |
</script> |
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
<form action="https://ws.thinkingphones.com/tpn-portlet/services/SimpleCallOriginationService/simplePlaceCall" method="post"> | |
<p><label>wsUser</label><input type="text" name="wsUser" value="nate-ws-admin" id="wsUser"></p> | |
<p><label for="wspassword">wsPassword</label><input type="text" name="wsPassword" value="C@11C4ncun5xy" id="wsPassword"></p> | |
<p><label for="uid">uid</label><input type="text" name="uid" value="davar.nate" id="uid"></p> | |
<p><label for="number">number</label><input type="text" name="number" value="3057737020" id="number"></p> | |
<p><input type="submit" value="Continue →"></p> | |
</form> |
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
// CANNED RESPONSES | |
$(document).ready(function() { | |
$('.opportunity').append('<div class="canned_responses"></div>'); | |
$.getJSON("/canned_responses.json", | |
function(data){ | |
$.each(data, function(i,item){ | |
$('.canned_responses').after('<div class="canned_titles" value=' + item._id + '>' + item.title + '</div>'); |
OlderNewer