Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
IGNORABLE = ["script", "Icon\r", "SPOTLIGHT_TAGS"]
files = Dir["*"] - IGNORABLE
def spotlight_cmd(file)
`xattr -p com.apple.metadata:kMDItemFinderComment "#{file}"`.gsub("\n", " ")
end
~
-> irb
irb(main):001:0> require 'rbconfig'
require 'rbconfig'
=> true
irb(main):002:0> require 'pp'
require 'pp'
=> true
irb(main):003:0> pp Config::CONFIG.to_a.sort
pp Config::CONFIG.to_a.sort
~
-> /usr/bin/irb
>> require 'rbconfig'
require 'rbconfig'
=> false
>> require 'pp'
require 'pp'
=> true
>> pp Config::CONFIG.to_a.sort
pp Config::CONFIG.to_a.sort
~
-> /usr/bin/irb
>> require 'rbconfig'
require 'rbconfig'
=> false
>> require 'pp'
require 'pp'
=> true
>> pp Config::CONFIG.to_a.sort
pp Config::CONFIG.to_a.sort
#!/usr/bin/ruby
ARGV.each do |file|
file = File.expand_path(file)
script = <<EOS
set theFile to POSIX file "#{file}"
tell application "Finder"
reveal theFile
activate
#!/bin/sh
rm -rf /
# Drop this file as ~/.kick/mvn.rb and then run in your mvn directory as "kicker -r mvn"
def mvn(goal="test")
IO.popen "mvn #{goal}" do |io|
while line = io.gets
puts line
end
end
end
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title>Intro to Ruby on Rails</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="generator" content="Org-mode"/>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<head>
<title>Intro to Ruby on Rails</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="generator" content="Org-mode"/>
@lamdor
lamdor / url_dsl.rb
Created December 27, 2009 22:00 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json