Skip to content

Instantly share code, notes, and snippets.

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);
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: &lt;/ars:img&gt;<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)
#!/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
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'
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
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) {
.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;
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);
var stitch = require('stitch');
var express = require('express');
var package = stitch.createPackage({
paths: [__dirname + '/lib'],
identifier : 'credibles'
});
var app = express.createServer();
app.configure(function(){
@mrkurt
mrkurt / deploy.rake
Created February 22, 2011 23:19
an ugly task for processing compass and whatnot, then deploying them to heroku
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'