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
var positive = [ | |
'http://foo.com/blah_blah', | |
'http://foo.com/blah_blah/', | |
'http://foo.com/blah_blah_(wikipedia)', | |
'http://foo.com/blah_blah_(wikipedia)_(again)', | |
'http://www.example.com/wpstyle/?p=364', | |
'https://www.example.com/foo/?bar=baz&inga=42&quux', | |
'http://✪df.ws/123', | |
'http://userid:password@example.com:8080', | |
'http://userid:password@example.com:8080/', |
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
<p>Date of last revision: December 22, 2010.<br><br>This policy contains nine sections, and you can jump to each by selecting the links below:<br><b><br>1. Introduction<br>2. Information We Receive<br>3. <span class="Apple-style-span"><b>Sharing information on Facebook</b></span><br>4. Information You Share With Third Parties<br>5. How We Use Your Information<br>6. How We Share Information<br>7. How You Can Change or Remove Information<br>8. How We Protect Information<br>9. Other Terms<br><br></b><strong>1. Introduction</strong><br><br><strong>Questions.</strong> If you have any questions or concerns about our privacy policy, contact our privacy team through this <a href="http://www.facebook.com/help/contact.php?show_form=privacy_policy_general">help page</a>. You may also contact us by mail at 1601 S. California Avenue, Palo Alto, CA 94304.<br><br><strong>TRUSTe Program.</strong> Facebook has been awarded TRUSTe's Privacy Seal signifying that this privacy policy and practices have been re |
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
new Mercury.PageEditor('/path/to/your/controller'); | |
Mercury.PageEditor.prototype.save = function() { | |
jQuery.ajax(this.saveUrl, { | |
type: 'POST', | |
data: {content: jQuery.toJSON(this.serialize()), _method: 'put'}, | |
success: function() { Mercury.changes = false }, | |
error: function() { alert("Mercury was unable to save to the url: " + this.saveUrl) } | |
}); | |
} |
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
# For Rails 3.1 asset packaging / sprockets support | |
# 1. Create a /config/evergreen.rb file and put these contents in it | |
# 2. Adjust the paths below (the provided ones are generic) | |
require ::File.expand_path('../application', __FILE__) | |
module Evergreen | |
class << self | |
def application_with_additions(suite) | |
app = application_without_additions(suite) |
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
// original javascript | |
String.prototype.singleDiff = function(that) { | |
var diff = ''; | |
var thatLength = that.length; | |
for (var i = 0; i < thatLength; ++i) { | |
if (this[i] != that[i]) { | |
var regExEscape = this.substr(i).regExEscape().replace(/^\s+|^( )+/g, ''); | |
var re = new RegExp(regExEscape + '$', 'm'); | |
diff = that.substr(i).replace(re, ''); | |
break; |
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
class NewArray extends Array | |
constructor: -> | |
super | |
toString: -> | |
'aaaaaaaaaaaaaaaaaa' | |
------------ |
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
# The following allows us to have a nested directory structure of specs. With | |
# a lot of specs this is needed. | |
module Evergreen | |
class Suite | |
def specs | |
Dir.glob(File.join(root, Evergreen.spec_dir, '**', '*_spec.{js,coffee}')).map do |path| | |
Spec.new(self, path.gsub(File.join(root), '')) | |
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
// version 1: working, but not providing what's being sent | |
// we need to have full posts come through so rails can get the info | |
xhr.open(this.method, this.action, true); | |
xhr.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*'); | |
xhr.setRequestHeader('Content-Type', 'multipart/form-data'); | |
xhr.setRequestHeader('X-Version', '1'); | |
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); | |
xhr.setRequestHeader('X-CSRF-Token', this.token); | |
xhr.setRequestHeader("X-File-Name", this.file.name); | |
xhr.setRequestHeader("X-File-Size", this.file.size); |
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"> | |
window['midas_setup_container'] = function() { | |
$('midas_container_selector').childElements().each(function(element) { | |
Event.observe(element, 'click', function(event) { | |
event.stop(); | |
this.execute('insertHTML', {action:'insertHTML', value: '<div class="' + element.getAttribute('data-class') + '"><br/></div>'}); | |
}.bind(this)); | |
}.bind(this)); | |
} | |
</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
require 'rack' | |
module Middleware | |
class Jammit | |
ROOT = '/app/javascripts' | |
def initialize(app, options = {}) | |
@app = app | |
@file_server = ::Rack::File.new(Protosite::Engine.root) | |
end |