Public Gists by mislav

gist: 223533 DataMapper self-referential...
Gravatar
Sun Nov 01 05:56:09 -0800 2009
1
2
3
require 'dm-core'
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, 'sqlite3::memory:')
Gravatar
Sun Nov 01 03:27:17 -0800 2009
1
2
3
What did you do to get good at Rails?
 
  Read source code, wrote plugins
gist: 220601 git "conflicts" and "resolv...
Gravatar
Wed Oct 28 09:20:35 -0700 2009
1
2
3
[alias]
conflicts = !git ls-files --unmerged | cut -c51- | sort -u | xargs $EDITOR
resolve = !git ls-files --unmerged | cut -c51- | sort -u | xargs git add
gist: 213833 OMG DataMapper friggin rocks
Gravatar
Mon Oct 19 16:25:26 -0700 2009
1
2
3
class Page
  include DataMapper::Resource
  
gist: 213794 A nifty link renderer for w...
Gravatar
Mon Oct 19 15:54:18 -0700 2009
1
2
3
## requires will_paginate "agnostic" branch
class NiftyRenderer < WillPaginate::ViewHelpers::LinkRenderer
  
gist: 210548 My Shortwave configuration
Gravatar
Wed Oct 14 18:10:44 -0700 2009
1
2
3
> This is a Shortwave configuration file
> http://shortwaveapp.com/
>
gist: 202132 Dump Twitter followers to J...
Gravatar
Mon Oct 05 06:47:48 -0700 2009
1
2
3
# Usage:
# ruby -rubygems json2csv.rb my-dump.json > people.csv
#
gist: 194816 URI templates are, like, su...
Gravatar
Sun Sep 27 08:31:21 -0700 2009
1
2
3
# previously required http://github.com/mislav/addressable
# with changes merged upstream, main repo should work too:
# http://github.com/sporkmonger/addressable/
gist: 188952 Geolocate users with modern...
Gravatar
Fri Sep 18 01:51:04 -0700 2009
1
2
3
  var geo = navigator.geolocation || (window.google && google.gears && google.gears.factory.create('beta.geolocation'));
  if (geo) geo.getCurrentPosition(displayLocation, handleError);
  
gist: 179892 Installation script for Ima...
Gravatar
Wed Sep 02 11:41:12 -0700 2009
1
2
3
#!/bin/sh
## install imagemagick on snow leopard: by kain, improved by mislav
## http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
gist: 147985 Experiment in pagination th...
Gravatar
Wed Jul 15 14:03:02 -0700 2009
1
2
3
ActiveRecord::Base.class_eval do
  def self.paginate_in_reverse(options = {})
    unless options[:page]
gist: 137005 monkeypatch for Haml to ski...
Gravatar
Sat Jun 27 06:57:13 -0700 2009
1
2
3
require 'haml'
 
Haml::Engine.class_eval do
gist: 128620 Thor task for easier hotfix...
Gravatar
Fri Jun 12 06:04:27 -0700 2009
1
2
3
# copy to your Capistrano recipe file
namespace :deploy do
  task :clear_cached_assets, :roles => :web do
gist: 127855 What makes you a Twitter sp...
Gravatar
Thu Jun 11 04:20:51 -0700 2009
1
2
3
Blocky (@blocky_bot, http://blocky.elliottkember.com) is a crowdsourcing
solution for Twitter spam. Blocky does not define what a "spammer" is,
so let's discuss.
gist: 118173 Update Ruby Enterprise Edit...
Gravatar
Tue May 26 10:08:53 -0700 2009
1
2
3
set -e
 
# for a setup script see http://gist.github.com/32917
gist: 112354 Ryan Bates community challe...
Gravatar
Fri May 15 11:18:08 -0700 2009
1
2
3
# COMMUNITY CHALLENGE
#
# How would you test this Quiz#problem method? Only two rules:
gist: 91737 Croatian translation for Ra...
Gravatar
Wed Apr 08 04:50:09 -0700 2009
1
2
3
"hr":
  date:
    formats:
gist: 80533 RSpec colorized unicode out...
Gravatar
Tue Mar 17 06:12:21 -0700 2009
1
2
3
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
RSpactor::Runner.class_eval do
gist: 76330 Cucumber steps that integra...
Gravatar
Mon Mar 09 07:30:30 -0700 2009
1
2
3
When /^I go to(?: the)? (.*?)(?: page)?$/ do |name|
  visit get_named_route(name)
end
gist: 71807 generic update checker meth...
Gravatar
Fri Feb 27 17:03:19 -0800 2009
1
2
3
var checkUserscriptUpdate = (function(){
  if (typeof GM_xmlhttpRequest != "function") return (function() {}) // no-op