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 | |
# Lighthouse + Git | |
# post-receive hook | |
LIGHTHOUSE_TOKEN = 'owner token here (the default one)' | |
LIGHTHOUSE_ACCOUNT = 'account (the subdomain)' | |
LIGHTHOUSE_PROJECT = 'project id (look in /projects/[id])' | |
# Store individual user tokens here. | |
# They are required so that changesets are mapped to the correct Lighthouse username |
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 'grit' | |
require 'net/http' | |
require 'json' | |
rev_old, rev_new, ref = STDIN.read.split(" ") | |
repo = Grit::Repo.new File.expand_path(".") | |
payload = { |
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
# >---------------------------------------------------------------------------< | |
# | |
# _____ _ _ __ ___ _ | |
# | __ \ (_) | \ \ / (_) | | | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | | |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | | |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | | |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_| | |
# | |
# This template was generated by RailsWizard, the amazing and awesome Rails |
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
alias served="ruby -r webrick -e \"s = WEBrick::HTTPServer.new(:Port => 9090, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.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
$(function() { | |
$('.placeholder input[type=text]').each(function() { | |
var placeholder = $(this).val(); | |
$(this).focus(function() { | |
if ($(this).val() == placeholder) { | |
$(this).val(''); | |
} | |
}); |
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
ericholmes@eric-imac ~ » curl -I http://www.site.com | |
curl: (6) Couldn't resolve host 'www.site.com' | |
ericholmes@eric-imac ~ » curl -I http://site.com | |
HTTP/1.1 302 Found | |
Date: Tue, 06 Mar 2012 18:56:21 GMT | |
Server: UltraDNS Client Redirection Server | |
Last-Modified: Tue, 06 Mar 2012 18:56:21 GMT | |
Accept-Ranges: none | |
Connection: close | |
Content-type: text/html |
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
# @order is created before each test runs | |
it "allows for the navision Id to be specified rather than the salesforce Id" do | |
@order.Status__c.should eq('Processing') | |
body = { | |
:order => { | |
:id => @order.Id, | |
:Status__c => "Processed", | |
:NavisionID__c => "testxxx_navision_id" | |
} | |
} |
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
@HttpPost | |
global static void updateOrder(Order__c order) { | |
if (order.Id == null && order.NavisionID__c != null) { | |
upsert order Order__c.NavisionID__c; | |
} else { | |
upsert order; | |
} | |
} |
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
env CC=/usr/bin/gcc rbenv install 1.9.3-p125 |
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
public class Tender { | |
public static String TENDER_SECRET = 'monkey'; | |
public static String DOMAIN = 'help.yourapp.com'; | |
public static String tenderize(String username) { | |
String expires = '1228117891'; | |
String input = DOMAIN + '/' + username + '/' + expires; | |
Blob hmac = Crypto.generateMac('hmacSHA1', Blob.valueOf(input), Blob.valueOf(TENDER_SECRET)); | |
return EncodingUtil.convertToHex(hmac); | |
} |
OlderNewer