This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
odd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2c9be0a2e7d52ba35b3d1f67766d637eb28aade2 Mon Sep 17 00:00:00 2001 | |
From: julik <julik@65967661-7906-0410-b21e-e24373c15fab> | |
Date: Fri, 19 Dec 2008 03:08:58 +0000 | |
Subject: [PATCH] Add Rubyforge version | |
--- | |
Rakefile | 1 + | |
1 files changed, 1 insertions(+), 0 deletions(-) | |
diff --git a/Rakefile b/Rakefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostalTimecode is a Timecode extension which supports soft_parse in new() | |
class PostalTimecode < Timecode | |
FH = ActionView::Helpers | |
TC_LENGTH = Timecode.new(0).to_s.length # by example | |
# Guarantee that PostalTimecode.new happens via soft_parse | |
def self.new(from, fps = Timecode::DEFAULT_FPS) | |
from.is_a?(String) ? soft_parse(from, fps) : super(from, fps) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var methods = { | |
labelActsAsHint: function(element){ | |
element = $(element); | |
element._default = element.value; | |
return element.observe('focus', function(){ | |
if(element._default != element.value) return; | |
element.removeClassName('hint').value = ''; | |
}).observe('blur', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'depix' | |
sources, renders = %w( in/*.DPX out/*.DPX ).map{|e| Dir.glob(e) } | |
sources.zip(renders).each do | (source, render) | | |
# Read the source TC and the target headers | |
from_dpx = Depix.from_file(source) | |
to_dpx = Depix::Editor.new(render) | |
# Copy the TC and the reel name over |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stream wrapper that read's IOs in succession. Can be fed to Net::HTTP. We use it to send a mixture of StringIOs | |
# and File handles to Net::HTTP which will be used when sending the request, not when composing it. Will skip over | |
# depleted IOs. Can be also used to roll across files like so: | |
# | |
# tape = TapeIO.new(File.open(__FILE__), File.open('/etc/passwd')) | |
class TapeIO | |
attr_accessor :substreams | |
attr_accessor :release_after_use | |
def initialize(*any_ios) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NestedParams | |
NESTED_PARAM_PREFIX = /^__nested_/i | |
module ControllerClassMethods | |
def expand_nested_params | |
before_filter :handle_params #{ |c| c.expand_nested_params(c.params) } | |
end | |
end | |
module ControllerInstanceMethods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VideoUpload | |
def self.new(*posargs_or_options) | |
if posargs_or_options.length > 1 # use old-style positional args | |
YouTubeG.logger.error "Positional arguments for VideoUpload.new are deprecated" | |
new(translate_posargs(posargs_or_options) | |
else | |
super(any_args.first || {}) # use the kwargs, super is just vanilla constructor | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Symptoms may include: | |
1. Knowing that you will have to write a router for the 10th time just because someone said YAGNI | |
(and knowing that having said "router" you would likely want it _both_ ways, yes I mean it thank you) | |
2. When talking about yourself as a developer you say | |
things like "I escape my URLs and preferably auto, and yes this includes the router" | |
3. You know you just don't need to rememder to have a form tag without do..end. because you use markaby anyway. | |
And you want your URL escaped | |
4. It doesn't feel right unless you have snatched escape_and_sanitize_ugly_html_gunk from bigframework and | |
of course you find out that it requires bigframework-*.gem, and the backing class for escape_and_sanitize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Cyril Rohr | |
require 'rubygems' | |
require 'rest_client' # sudo gem install rest-client | |
require 'rack/cache' # sudo gem install rack-cache | |
module RestClient | |
# this is a quick hack to show how you can use rack-cache as a powerful client cache. | |
class CacheableResource < Resource | |
attr_reader :cache | |
CACHE_DEFAULT_OPTIONS = {}.freeze |
OlderNewer