Skip to content

Instantly share code, notes, and snippets.

View bensie's full-sized avatar

James Miller bensie

View GitHub Profile
defaults write com.macromates.textmate OakDefaultLanguage E00B62AC-6B1C-11D9-9B1F-000D93589AF6
// Create a simple top to bottom linear gradient with a background-color backup
// The first argument, $color will be output as background-color: $color
//
// This yields a gradient that is 5% brighter on the top and 5% darker on the bottom
//
// +gradient-bg(#777)
//
// This yeilds a gradient where the bright and dark colors are shifted 10% from the original color.
// If you don't specify a third argument it will assign this value for the darkness too, keeping the gradient even.
//
@imathis
imathis / _extensions.sass
Created November 5, 2010 18:58
Creates a nice 3D ribbon effect with CSS only
=gradient-bg($color, $top: 5, $bottom: $top)
@if $top < 0 and $bottom < 0
$color1: darken($color, abs($top))
$color2: lighten($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
@else
$color1: lighten($color, abs($top))
$color2: darken($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
background-color: $color
@iDiogenes
iDiogenes / gist:702051
Created November 16, 2010 16:47
daemon
#!/usr/bin/env ruby
# Daemon script for running ifs_notify
# The script can start, stop and check status of ifs_notify
pwd = Dir.getwd
file = pwd + "/ifs_notify"
pidfile = "../var/ifs_notify.pid"
# Starting ifs_notify
@alunny
alunny / description.md
Created November 26, 2010 22:22
my git configuration

My Git Configuration

For best results, use hub and git bash completion (included with git under contrib/completion).

@caged
caged / local-conversion.js
Created November 29, 2010 19:11
All the parts we use to convert dates on the page to local times
var date = new Date();
var offset = date.getTimezoneOffset();
$.cookie('tzoffset', offset, { path: '/' })
/**
* Add age-based class name
*/
$this.find('p.date .timestamp').each(function() {
var el = $(this),
@robhurring
robhurring / usage.rb
Created November 30, 2010 21:34
http auth basic request with warden. simple method
use Warden::Manager do |config|
config.default_strategies :basic
config.failure_app = ErrorsController.action(:unauthenticated)
end
Warden::Strategies.add :basic, HttpAuthBasicStrategy do |config|
config.realm = "Welcome!"
config.callback do |env, username, password|
return username if username == 'rob'
false
#! /usr/bin/env ruby
status = DATA.flock(File::LOCK_EX | File::LOCK_NB)
if status == 0
puts "we have the lock..."
sleep
else
#!/usr/bin/env ruby
# Daemon script for running ifs_notify
# The script can start, stop and check status of ifs_notify
pwd = Dir.getwd
file = pwd + "/ifs_notify"
pidfile = "../var/ifs_notify.pid"
# Starting ifs_notify
@chriseppstein
chriseppstein / compass.rb
Created January 18, 2011 05:56
The compass configuration file at caring.com
if ENV['RAILS_ENV'] && !defined?(RAILS_ENV)
Object.const_set("RAILS_ENV", ENV['RAILS_ENV'])
end
# Require any additional compass plugins here.
require 'grid-coordinates'
require 'compass-fancybox-plugin'
require 'susy'
project_type = :rails