Skip to content

Instantly share code, notes, and snippets.

View timriley's full-sized avatar
🇺🇦
Standing with Ukraine

Tim Riley timriley

🇺🇦
Standing with Ukraine
View GitHub Profile
@chriseppstein
chriseppstein / tracer.rb
Created May 3, 2009 23:02
Tracing ruby method calls
module Tracer
def trace(method)
method, ending = split_method_name(method)
define_method "#{method}_with_trace#{ending}" do |*arguments|
puts "called #{self.class}##{method}#{ending}(#{arguments.map(&:inspect).join(', ')})"
returning(send("#{method}_without_trace#{ending}", *arguments)) do |v|
if block_given?
yield self, v
end
puts "#{self.class}##{method}#{ending} => #{v.inspect}"
@pat
pat / application_controller.rb
Created June 15, 2009 21:51
Returning HTML in AJAX calls, without layouts.
# Three things to add:
# * before_filter call
# * action_has_layout? method (if you have one, combine them)
# * adjust_for_inline
#
class ApplicationController < ActionController::Base
# ...
before_filter :adjust_for_inline
/* Instructions:
*
* Download to ~/.mailplane.css
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetLocationPreferenceKey -string ~/.mailplane.css`
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetEnabledPreferenceKey -bool true`
*
*/
body {
font-family: Helvetica; !important
@joho
joho / envato-senior-dev.markdown
Created November 16, 2009 05:08
Senior Ruby on Rails Developer @ Envato

Senior Ruby on Rails Developer @ Envato

Hi, we're Envato and we're looking for a "senior" Ruby on Rails developer.

We know it's a bit absurd to ask for seniors for a new-ish technology, but we're more looking for the senior mindset, for depth and breadth of experience in delivering good quality code, and helping your teammates achieve the same. We need the kind of people we can point at a big problem with maybe another dev or two by their side and come out with a neat solution on the other side. We'd prefer to hire someone with practical, commercial Ruby on Rails experience, but if you're a Python, Java, .NET, Haskell, LISP, or whatever else developer who picks up new things quickly and can get things DONE we want to speak with you.

First though: a bit about us. We're a youngish company, transitioning out of the hectic startup days and into something a bit bigger and more settled. We operate a series of online stock digital media marketplaces such as Activeden (formerly FlashDen), GraphicRiver, ThemeF

@jgallen23
jgallen23 / ir_black.taskpapertheme
Created March 31, 2010 04:36
TaskPaper IRBlack Theme
<theme>
<!-- Window Style -->
<color id="foreground" red="0.59" green="0.80" blue="0.99" alpha="1.0" />
<color id="background" red=".1" green=".1" blue=".1" alpha=".95" />
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="yes" />
<!-- Text View Style -->
<color id="tag" red=".48" green=".48" blue=".48" alpha="1.0" />
<color id="handle" extendsColorID="foreground" />
<color id="insertionPoint" red=".4" green=".4" blue=".4" alpha="1.0" />
#!/usr/bin/env ruby
# [You need dropbox - http://dropbox.com/]
# cd ~/Dropbox
# mkdir ssh
# cd ssh
# git init
# cd .git/hooks
# [paste this file into post-commit]
# chmod 755 post-commit
@mrrooijen
mrrooijen / carrierwave_tasks.rb
Created June 2, 2010 00:27
Rake Tasks for Carrier Wave for reprocessing versions.
##
# CarrierWave Amazon S3 File Reprocessor Rake Task
#
# Written (specifically) for:
# - CarrierWave
# - Ruby on Rails 3
# - Amazon S3
#
# Works with:
# - Any server of which you have write-permissions in the Rails.root/tmp directory
@filterfish
filterfish / Light weight rvm
Created July 16, 2010 00:38
Lightweigh version of rvm.
#!/usr/bin/env ruby
require 'pp'
require 'pathname'
search_paths = ['/usr/local']
Conf_file = "#{ENV['HOME']}/.lrvm"
def write_path(path)
DRAFT SPECIFICATION
# Zhook: Zip + HTML + Book.
Software that displays a Zhook file is here called a Reading System (RS).
A Zhook file is a zip file with a .zhook extension, which must contain:
* index.html (the Index)
# AViewController.h
@interface AViewController : UIViewController
{
}
@property(readwrite, retain) NSString *aString;
@property(readwrite, assign, getter=isReady) BOOL ready;
# AViewController.m
@implementation AViewController