This file contains hidden or 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 dashes = ""; var num = 20; while(--num) dashes += "-"; setInterval(function() { window.history.pushState("", "", '/sticky-history?' + dashes.slice(0, num % 20) + "foo" + dashes.slice(num % 20)); num++;}, 100); |
This file contains hidden or 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 Image < Rule | |
IMG_ATTRIBUTES = [:src, :title, :alt] | |
tag 'ars:img' | |
description "An image with optional alignment, caption and link. <strong>Make sure you add a closing tag: </ars:img><br />The WYSIWYG editor in Movable Type screws up self closing tags and we wouldn't want to make more work for Eric</strong>." | |
required_attributes :src | |
optional_attributes :class, :width, :height, :href, :credit, :'credit-href', IMG_ATTRIBUTES | |
validate do |node| | |
errors = Helpers.validate_container(node) |
This file contains hidden or 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/sh | |
coffee -r ./app/scripts/production-replacements.coffee -c -o public/javascripts app/scripts/copypasta.coffee | |
git update-index --no-assume-unchanged public/javascripts/copypasta.js | |
git add -f public/javascripts/copypasta.js |
This file contains hidden or 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
scripts = [ | |
{ | |
test: ()-> window.jQuery && window.jQuery.fn && window.jQuery.fn.jquery > "1.4.2" | |
src: 'http://localhost:3000/javascripts/jquery-1.4.2.min.js' | |
callback : ()-> | |
($ = window.jQuery).noConflict(1) | |
}, | |
{ | |
test: ()-> window.jQuery && window.jQuery.fn.lightbox_me | |
src: 'http://localhost:3000/javascripts/jquery.lightbox_me.js' |
This file contains hidden or 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
copypasta.locate_text_container = ()-> | |
parent = false | |
biggest = false | |
biggest_count = 0 | |
parent_count = 0 | |
for p in document.getElementsByTagName('p') when p? | |
if parent != p.parentElement | |
if parent_count > biggest_count | |
biggest_count = parent_count | |
biggest = parent |
This file contains hidden or 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
copypasta.locate_text_container = function() { | |
var biggest, biggest_count, p, parent, parent_count, _i, _len, _ref; | |
parent = false; | |
biggest = false; | |
biggest_count = 0; | |
parent_count = 0; | |
_ref = document.getElementsByTagName('p'); | |
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | |
p = _ref[_i]; | |
if (p != null) { |
This file contains hidden or 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
.button, input[type=submit], input[type=button]{ | |
border: 0px; | |
margin: 0px; | |
color: white; | |
font-size: 12px; | |
padding: 5px 12px; | |
vertical-align: middle; | |
text-align: center; | |
text-decoration: none; | |
font-weight: bold; |
This file contains hidden or 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 credibles = (function(modules) { | |
var exportCache = {}; | |
return function require(name) { | |
var module = exportCache[name]; | |
var fn; | |
if (module) { | |
return module; | |
} else if (fn = modules[name]) { | |
module = { id: name, exports: {} }; | |
fn(module.exports, require, module); |
This file contains hidden or 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 stitch = require('stitch'); | |
var express = require('express'); | |
var package = stitch.createPackage({ | |
paths: [__dirname + '/lib'], | |
identifier : 'credibles' | |
}); | |
var app = express.createServer(); | |
app.configure(function(){ |
This file contains hidden or 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
namespace :credibles do | |
desc "Pre compiles assets" | |
task :deploy => ['credibles:prep_heroku', 'assets:compile', 'credibles:push_heroku'] | |
task :prep_heroku do | |
puts "Switching to staging branch...\n" | |
system "git checkout -b staging || git checkout staging" | |
puts "Checking heroku remote...\n" | |
system 'git remote add heroku [email protected]:credibles.git || echo "remote exists"' | |
puts "Pulling down heroku changes...\n" | |
system 'git pull heroku master' |