Skip to content

Instantly share code, notes, and snippets.

@kolber
kolber / index.html
Created August 20, 2010 06:11 — forked from rails/gist:58761
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words = function(from, to) {
var to = to ? new Date(to) : new Date,
from = new Date(from);
var seconds = ((to - from) / 1000),
minutes = (seconds / 60);
if (minutes == 0) return 'less than a minute ago';
/\n\s+\n/\n\n/
@kolber
kolber / N3RD5
Created January 27, 2011 05:54 — forked from jmac/NERDS
Y0u guy5 ar3 th3 gr34t35t.
@kolber
kolber / sequential-gallery.html
Created January 28, 2011 03:35
A dead simple, sequential image gallery (good for pulling together quick in-browser design presentations)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>expanding image</title>
<style>
.wrapper { margin: 0px auto; padding: 0px 320px; *width: 920px; max-width: 920px; border: 3px solid red; }
.wrapper img { width: 100%; -ms-interpolation-mode: bicubic; }
</style>
</head>
@kolber
kolber / export.php
Created February 24, 2011 03:40
Stacey, A quick and dirty HTML export script
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Export</title>
<style> div { display: none; }</style>
</head>
<body>
<?php
# Usage:
@kolber
kolber / _grid.scss
Created March 4, 2011 01:24
A simple, extendable scss grid system generator
/*
Usage
-----
In your main scss file, add the following three lines.
$show-grid: true;
$container-id: container;
@import "grid";
To hide the grid background and borders, change the first line to
@kolber
kolber / random-json-images.html
Created October 18, 2011 11:46
Random JSON table
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>JSON table</title>
<style>
td { border: 1px solid black; padding: 10px; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
window.json = [
@kolber
kolber / nginx.conf
Created October 25, 2011 03:11
Simple virtualhost setup that passes static files to nginx and everything else to Apache
http {
server {
server_name ~^(.+)$;
set $domain $1;
root /var/www/dropbox/$domain;
location / {
proxy_pass http://127.0.0.1:8000;
@kolber
kolber / gist:1433472
Created December 5, 2011 12:39
command line base64
openssl base64 < ajax-loader.gif | tr -d '\n' | pbcopy