Skip to content

Instantly share code, notes, and snippets.

View gr2m's full-sized avatar

Gregor Martynus gr2m

View GitHub Profile
gr2m / gibberish.rake
Created October 21, 2009 11:12 — forked from karmi/gibberish.rake
updated karmi's gist with support for empty brackets, like "Users"[]
View gibberish.rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
require 'fileutils'
View CSS for Mad Libs styie forms
.mad-lips label {
white-space: nowrap;
padding: 0 0 .5em;
display: -moz-inline-stack;
display: inline-block;
vertical-align: top;
zoom: 1;
*display: inline;
gr2m / jQuery_reverse.js
Created April 24, 2010 00:59
reverse function for jQuery
View jQuery_reverse.js
$.fn.reverse = [].reverse;
gr2m / trim.js
Created April 26, 2010 19:41
trim() function for Strings
View trim.js
// add trim to String Object
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '')
View make_a_block_clickable.css
MAKE the whole block actionable with CSS only.
<div id="block" title="read more about ...">
<h3><a href="...">Some title here</a></h3>
<p>bla bla bla .... bla!</p>
View gregor-multiple-group-bys-sort-by-sumd-group-values.sql
project_name, service_name, project_minutes, minutes
SELECT as project_id, as project_name, as service_name,
View mite.add_all_projects_for_timetracker
View safari5_bugreport.txt
* set your timezone to Auckland, New Zealand.
There is a bug with the Date Object. »new Date("2010/9/26")« returns
»Sat Sep 25 2010 23:00:00 GMT+1200 (NZST)«
gr2m / mite.load_billable_time_for_today.js
Created November 4, 2010 11:20
loads the time that is billable for today out of your
View mite.load_billable_time_for_today.js
function(data) { alert($mite.minutes.minToStr(data[0].time_entry_group.minutes))}
gr2m / jquery.focus_select.js
Created May 1, 2011 00:21
$('input, select').focus_select() will focus the <select> and select the <input>. select does not work on <select>s
View jquery.focus_select.js
jQuery.fn.focus_select = function() {
return this.each(function(){
var $this = jQuery(this);
if ( $'select') ) {
} else {