Skip to content

Instantly share code, notes, and snippets.

$(function() {
// Wrap a container around images.
// Change $("img") to the appropriate selector.
$("img").wrap("<div class='polaroid'></div>").wrap("<div class='film'></div>");
// Start the polaroids with low opacity.
$(".polaroid img").css("opacity", .1);
// Rotate the polaroids a bit.
.film {
background: #000;
}
.polaroid {
background: #fff;
padding: 5%;
padding-bottom: 15%;
@include box-shadow(0 2px 5px rgba(0,0,0,.25));
}
@eheikes
eheikes / gist:3606459
Created September 3, 2012 03:01
Is this really the best way to print a date?
<P>&#169; <SPAN id=footerdate>2010</SPAN> City of Ankeny. All Rights Reserved. <A href="Index.aspx?page=34">Privacy Policy and Disclaimer</A> | Website&nbsp;CMS by <A href="http://www.visioninternet.com/">Vision Internet</A>.
<script type="text/javascript">
var footerDateContainer = document.getElementById('footerdate');
try{
if ( footerDateContainer != null && footerDateContainer != "undefined" )
footerDateContainer.innerHTML = "2012";
}
@eheikes
eheikes / assets-graphviz.rb
Created October 29, 2012 20:38 — forked from cthiel/assets-graphviz.rb
Rails 3.1 stylesheet assets dependency graph
#!/usr/bin/ruby
#
# (c) 2011 SUSE Linux Products GmbH, Author: Christoph Thiel <cthiel@suse.com>
#
# script that generate dependency graph for Rails 3.1 stylesheet assets
#
# usage: sudo rubygem install ruby-graphviz
# cp assets-graphviz.rb yourapp/app/assets/
# cd yourapp/app/assets/; chmod +x assets-graphviz.rb; ./assets-graphviz.rb
@eheikes
eheikes / paam.js
Last active October 12, 2015 05:37
Script to create a single-use short URL using the pa.am service
(function(){
var form=document.createElement('FORM');
form.action='http://pa.am/new';
form.method='post';
var mode=document.createElement('INPUT');
mode.name='mode';
mode.type='hidden';
mode.value='0';
form.appendChild(mode);
# Start all project servers, one per screen.
# http://superuser.com/questions/91881/invoke-zsh-having-it-run-a-command-and-then-enter-interactive-mode-instead-of
screen -t Web 1 zsh -ic 'cd ~/www/goodsmiths/ && gpull; bundle exec foreman start; zsh -i'
screen -t API 2 zsh -ic 'cd ~/www/goodsmiths_recommendation_engine && gpull && bundle exec foreman start; zsh -i'
screen -t AS 3 zsh -ic 'cd ~/www/goodsmiths_activity_stream && gpull && bundle exec foreman start; zsh -i'
screen -t GE 4 zsh -ic 'cd ~/www/goodsmiths_gaminator && gpull && bundle exec foreman start; zsh -i'
# Change the hardstatus settings to give an window list at the bottom of the screen, with the time and date and with the current window highlighted.
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
@eheikes
eheikes / fucking
Last active December 14, 2015 19:39
batch scripts
#!/bin/bash
case $1 in
"die")
pkill ruby
pkill rake
pkill redis-server
pkill searchd
pkill mongo
;;
"repair")
@eheikes
eheikes / initial_setup.sh
Last active May 12, 2017 00:29
Initial configuration and installation of services common to all servers.
#!/bin/bash -x
# <UDF name="aq_password" Label="Administrator Password" />
# <UDF name="new_hostname" Label="Computer Hostname (all lowercase)" example="basicshared1" />
# Include http://www.linode.com/stackscripts/view/?StackScriptID=1
source <ssinclude StackScriptID="1">
#
# Initial setup.
# Based on http://library.linode.com/getting-started/
@eheikes
eheikes / apache.sh
Last active April 25, 2017 01:33
Installs the latest Apache package and configures it.
#!/bin/bash -x
# Dependency: UFW should be installed before this script is executed.
# <UDF name="new_hostname" Label="Computer Hostname" example="BasicShared1" />
# Include http://www.linode.com/stackscripts/view/?StackScriptID=1
source <ssinclude StackScriptID="1">
#
@eheikes
eheikes / jungledisk.sh
Created April 10, 2013 02:15
Installs and configures the JungleDisk server.
#!/bin/bash -x
# <UDF name="jungledisk_license" Label="JungleDisk License Key" />
# Include http://www.linode.com/stackscripts/view/?StackScriptID=1
source <ssinclude StackScriptID="1">
#
# Install JungleDisk backup
#
cd