Skip to content

Instantly share code, notes, and snippets.

@meleyal
meleyal / fakeout.rake
Created March 2, 2011 17:23 — forked from matthutchinson/fakeout.rake
Fakeout.rake
# a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes
# NOTE: requires the faker or ffaker gem
require 'faker'
class Fakeout
# START Customizing
# 1. first these are the model names we're going to fake out
@meleyal
meleyal / active-record-recipes.rb
Created March 10, 2011 12:00
active record recipes
# random records
scope :random, limit(5).order("RANDOM()")
@meleyal
meleyal / app.js
Created March 18, 2011 15:08
simple backbone example
var App = {
initialize: function() {
new App.Controller();
Backbone.history.start();
}
};
@meleyal
meleyal / reveal.css
Created March 26, 2011 09:10
Apple.com reveal fx
body { background:url(http://images.apple.com/global/elements/quicktime/loading.gif) no-repeat 50% 150px; }
body.loaded { background:transparent; }
#showcase .content,
#promobar,
#itunes,
#globalfooter { opacity:0; -webkit-transition:opacity .5s; -moz-transition:opacity .5s; }
.loaded #showcase .content,
.loaded #promobar,
@meleyal
meleyal / fileapi_test.patch
Created June 24, 2011 10:50
Modernizr test for File API support
From 509d6f93d51efaee274d267c030ac2855aa799d7 Mon Sep 17 00:00:00 2001
From: meleyal <william.meleyal@gmail.com>
Date: Fri, 1 Apr 2011 00:25:34 +0200
Subject: [PATCH] add test for File API support
---
modernizr.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modernizr.js b/modernizr.js
@meleyal
meleyal / error
Created September 2, 2011 08:51
typus admin user
undefined local variable or method `admin_user' for Admin::StudentsController:Class
@meleyal
meleyal / optimize_images.rb
Created October 19, 2011 11:10
Simple png + jpg optimization script using optipng + jpegtran
#!/usr/bin/ruby
# Instructions
# - Install optipng + libjpeg (http://mxcl.github.com/homebrew/)
# - Put this file in a directory of images
# - Open in TextMate + run it (cmd+r)
# Config
// Let's start with the basics
$base-color: #333;
$active-color: #ff8100;
$base-gradient: 'flat';
// Buttons
$button-gradient: 'bevel';
// Lists
$list-bg-color: #eee;
@meleyal
meleyal / simplegrid.scss
Created November 30, 2011 17:24
SimpleGrid
/*! -----------------------------------------------
* simplegrid.scss
* https://gist.github.com/gists/1409900/
* Custom version of 960.gs (http://960.gs/)
* Naming inspired by SimpleBits (http://simplebits.com/)
* Licensed under GPL and MIT
*
* Custom:
* - columns > 12
* - underscores > dashes
@meleyal
meleyal / mp3_duration.rb
Created December 6, 2011 14:58
Get duration of all MP3s in a directory (recursively)
# INSTRUCTIONS
# - Puth this file into a directory containing mp3s
# - Open in TextMate + run it (cmd+r)
# - get_audio_length method via: http://bit.ly/sIKObq
dir = File.dirname(__FILE__)
mp3s = File.join(dir, "**", "*.mp3")