Skip to content

Instantly share code, notes, and snippets.

@rds
rds / contents.erb
Created September 22, 2012 17:10
Add more customisation options to Compass' sprite importer
@import "compass/utilities/sprites/base";
@mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false, $prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0) {
@each $sprite-name in $sprite-names {
@if sprite_does_not_have_parent($map, $sprite-name) {
$full-sprite-name: "#{$prefix}#{$sprite-name}";
.#{$full-sprite-name} {
@if $base-class { @extend #{$base-class}; }
@include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y);
}
@rds
rds / PoolsController.rb
Created January 31, 2012 16:48 — forked from smooki/PoolsController.rb
no association in params for create ...
class PoolsController < ApplicationController
def index
@event = Event.find params[:event_id]
@pools = @event.pools
end
def new
type = nil
type = params[:type] if ["date", "text"].include?params[:type]
@rds
rds / spotify.js
Created January 24, 2011 19:24
Spotify Metadata API helpers for jQuery
(function($) {
$.grepWithLimit = function( elems, callback, limit, inv ) {
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
#!/bin/bash
# Unattended REE/Passenger installation
# Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/
# 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys
if [ "$(whoami)" != "root" ]; then
echo "You need to be root to run this!"
exit 2
fi