Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# http://gist.github.com/4529
class File
def self.svn? path
File.exists?(path + '/.svn/')
end
def self.git? path
File.exists?(path + '/.git/')
end
def self.hg? path
@subtleGradient
subtleGradient / Brilliance DEBUG.Espresso.CSS
Created January 30, 2009 17:00
Espresso Theme for Language Debugging
/*
@theme Brilliance Debug
@override-placeholders html, xml, sourcecode.js
*/
/*color: rgba(0,97,244,0.25);*/
@base {
color: #f00;
color: rgb(244,0,97);
background-color: #000;
/*
@theme Brilliance Debug
@override-placeholders html, xml, sourcecode.js
*/
/*color: rgba(0,97,244,0.25);*/
@base {
color: #f00;
color: rgb(244,0,97);
background-color: #000;
{ scopeName = 'source.ruby.experimental';
foldingStartMarker = '(?x)^
(\s*+
(module|class|def
|unless|if
|case
|begin
|for|while|until
|^=begin
|( "(\\.|[^"])*+" # eat a double quoted string
@subtleGradient
subtleGradient / Functional ASCii Art
Created January 22, 2009 21:17
Stupid Javascript tricks: self-chained function; Functional ASCii Art.js
function chained(){ console.log(arguments); return arguments.callee; };
chained(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
@subtleGradient
subtleGradient / Mootools excanvas wrapper.js
Created January 22, 2009 01:44
Mootools excanvas wrapper, because ibolmo moocanvas doesn't support image rotate well. MIT Licenced - Daniel Steigerwald (daniel.steigerwald.cz)
/*
* Mootools excanvas wrapper, because ibolmo moocanvas doesn't support image rotate well.
*
* MIT Licenced - Daniel Steigerwald (daniel.steigerwald.cz)
*
*/
var Canvas = new Class({
initialize: function() {
var params = Array.link(arguments, { document: Document.type, properties: Object.type });
@subtleGradient
subtleGradient / csv_to_json_hash
Created January 10, 2009 17:56
convert CSV to JSON hash of hashes
#!/usr/bin/env ruby
# convert CSV to JSON hash of hashes
# uses the first column as the ID column, must be unique per row
# takes the CSV filepath as first argument
# fallsback to STDIN when there are no arguments
require 'rubygems'
require 'csv'
require 'json'
@subtleGradient
subtleGradient / curtain.css
Created December 18, 2008 22:51
Lightbox Background Curtain using only CSS
/*Style*/
.curtain{
color: rgb(32,32,32);
background-color: rgb(32,32,32);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: alpha(opacity=80);
-moz-opacity: 0.8;
opacity: 0.8;
}
/*Positioning*/
var SubtleBenchmarker = new new Class({
benchmarks:{},
start : function(key){
this.benchmarks[key] = this.benchmarks[key] || [];
this.benchmarks[key].push({ start:new Date() });
},
end : function(key){
this.benchmarks[key][this.benchmarks[key].length-1].end = new Date();
From d954fbce5fbfc5d6070d796afacf998036c0cd51 Mon Sep 17 00:00:00 2001
From: subtleGradient <oblivious+github@subtleGradient.com>
Date: Thu, 20 Nov 2008 08:51:07 -0700
Subject: [PATCH] Move observe into a method so that it can be observed
---
Autocompleter.js | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Autocompleter.js b/Autocompleter.js