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
/* | |
Requirements: | |
This script requires the jquery.includeMany plugin and ZeroClipboard. | |
Example: | |
$("#elementToClickOn").copyable(function(e, clip) { | |
clip.setText($("#elementWithText").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
module Payex | |
mattr_accessor :account_number | |
mattr_accessor :encryption_key | |
MD5_CHECK_FIELDS = { | |
"pxorder/pxorder.asmx/Initialize7" => [:accountNumber, :purchaseOperation, :price, :priceArgList, :currency, :vat, :orderID, :productNumber, :description, :clientIPAddress, :clientIdentifier, :additionalValues, :externalID, :returnUrl, :view, :agreementRef, :cancelUrl, :clientLanguage], | |
"pxagreement/pxagreement.asmx/CreateAgreement3" => [:accountNumber, :merchantRef, :description, :purchaseOperation, :maxAmount, :notifyUrl, :startDate, :stopDate], | |
"pxagreement/pxagreement.asmx/DeleteAgreement" => [:accountNumber, :agreementRef], | |
"pxorder/pxorder.asmx/Complete" => [:accountNumber, :orderRef], | |
"pxagreement/pxagreement.asmx/AutoPay2" => [:accountNumber, :agreementRef, :price, :productNumber, :description, :orderId, :purchaseOperation], |
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 | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
Multi-Firefox Fixer - v0.2 - 4/26/2011 | |
http://benalman.com/ | |
Usage: `basename "$0"` | |
Run this shell script from beside (in the same parent directory as) one or more | |
Firefox*.app or Aurora*.app applications and it will "fix" those Firefoxes to |
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 "uri" | |
require "active_support" | |
# Get auth token from Googles | |
auth_uri = "https://www.google.com/accounts/ClientLogin" | |
params = { | |
"accountType" => "HOSTED_OR_GOOGLE", | |
"Email" => "yer_gmail", | |
"Passwd" => "yer_gpass", | |
"source" => "organization-appname-version", |
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
# Pass in the name of the site you wich to create a cert for | |
domain_name = ARGV[0] | |
if domain_name == nil | |
puts "Y U No give me a domain name?" | |
else | |
system "openssl genrsa -out #{domain_name}.key 1024" | |
system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'" | |
system "cp #{domain_name}.key #{domain_name}.key.bak" |
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
# powjs r1 - @weskoop | |
# Config.ru concept and file by Assaf Arkin http://labnotes.org/2011/08/06/using-pow-with-your-node-js-project/ | |
function powjs { | |
if [[ $# -ne 0 ]]; then | |
if [[ $1 == "config" ]]; then | |
echo "Creating Node compatible config.ru..." | |
cat > config.ru <<POWJS | |
require "net/http" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<script id="whatever">document.write('<!'+'--')</script> | |
<img src="filth.jpg" /> | |
<!----> | |
<script> | |
// filth.jpg will start loading now for users without js. |
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
# Used with: | |
# gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' | |
if Rails.env.development? | |
def after_task(task_name, &new_task) | |
old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s) | |
desc old_task.full_comment | |
task task_name do | |
old_task.invoke | |
new_task.call |
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
rescue_from = {} | |
# Associate status code with an HTTP status code. First argument is the status | |
# code, second argument is a function that accepts the XHR object. For example: | |
# $.rescueFrom 404, (xhr)-> alert("Oh no, page not found!") | |
$.rescueFrom = (status, fn)-> | |
rescue_from[status] = fn | |
# Default handling for unsuccessulf HTTP status code. Finds and calls most | |
# appropriate handler based on the HTTP status code (see `$.rescueFrom`). |
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
diff --git a/lib/compiler/ast/transforms.rb b/lib/compiler/ast/transforms.rb | |
index 19e1cfb..4e52ec2 100644 | |
--- a/lib/compiler/ast/transforms.rb | |
+++ b/lib/compiler/ast/transforms.rb | |
@@ -59,6 +59,71 @@ module Rubinius | |
end | |
end | |
+ # Provide an underscore node that allows partial application in Ruby. | |
+ # Instead of doing a method call, we are going to generate a lambda |
OlderNewer