Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>this is a page title</title>
</head>
<body>
<p>this is a body</p>
def get_remote_file(uri)
require 'open-uri'
begin
uploadedfile = nil
open(uri) do |remote|
uploadedfile = StringIO.new(remote.read)
filename = File.basename(uri)
(class << uploadedfile; self; end).class_eval do
define_method(:local_path) { "" }
define_method(:original_filename) { filename }
module WithScopes
def with_scopes(*named_scopes)
named_scopes.inject(self) { |klass, scope| klass.send(scope) }
end
end
ActiveRecord::Base.extend(WithScopes)
def test
str = "this is a test of new pastie"
# print out the test msg
puts str
end
@NZKoz
NZKoz / A File
Created July 22, 2008 15:51
lulz?
WTFsrsly
@maxterry
maxterry / aif.js
Created July 22, 2008 15:51
open web functions
aif = function(_) {
_ = Array.slice(arguments)
return(each(_, function(i) {
if(i % 2 == 0 && !!this) {
return(fn.apply(this))
}
}))
}
test edit of my gist
@mathie
mathie / gist:1111
Created July 22, 2008 16:00 — forked from st23am/gist:1098
def test
str = "this is a test of new pastie"
# print out the test msg
puts str
end
We couldn’t find that file to show.
Another test paste I guess