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
# in lib/patches/facebooker.rb | |
module Facebooker | |
module Rails | |
module Helpers | |
def fb_wallpost(user,message,time) | |
content_tag("fb:wallpost",message,:uid=>cast_to_facebook_id(user),:t=>time.to_i) | |
end | |
end | |
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
require 'pathname' | |
require 'test/unit' | |
require 'rubygems' | |
require 'sqlite3' | |
require 'activerecord' | |
begin | |
require 'ruby-debug' | |
rescue LoadError, RuntimeError | |
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
... | |
Package libpcre was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `libpcre.pc' | |
to the PKG_CONFIG_PATH environment variable | |
No package 'libpcre' found | |
In file included from vm/string.c:3: | |
vm/tr.h:12:18: error: pcre.h: No such file or directory | |
In file included from vm/string.c:3: | |
vm/tr.h:285: error: expected specifier-qualifier-list before ‘pcre’ | |
make: *** [vm/string.o] Error 1 |
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
In response to all the responses to: | |
http://twitter.com/rtomayko/status/1155906157 | |
You should never do this in a source file included with your library, | |
app, or tests: | |
require 'rubygems' | |
The system I use to manage my $LOAD_PATH is not your library/app/tests |
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
# Run me with: | |
# | |
# $ watchr specs.watchr.rb | |
# -------------------------------------------------- | |
# Convenience Methods | |
# -------------------------------------------------- | |
def all_test_files | |
Dir['test/**/test_*.rb'] - ['test/test_helper.rb'] | |
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
# Run me with: | |
# | |
# $ watchr docs.watchr.rb | |
def run_rdoc | |
system('rake --silent rdoc') | |
end | |
def run_yard | |
print "\nUpdating yardocs... " |
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
uniques = results.delete_if {|r| r['occurrences'] == 1 }.map {|r| r['id'] } | |
duplicates = results.map {|r| r['id'] } |
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
~| gem list swap | |
*** LOCAL GEMS *** | |
~| irb | |
>> require 'swap' | |
=> true | |
>> $:.map {|p| Dir[File.join(p, '*')] }.flatten.map {|p| File.basename(p) }.grep(/wirble/) | |
=> ["wirble.rb"] |
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
# Run me with: | |
# | |
# $ watchr less.watchr | |
# -------------------------------------------------- | |
# Helpers | |
# -------------------------------------------------- | |
def lessc(file) | |
print "compiling #{file.inspect}... " | |
system "lessc #{file}" |
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
Desired=Unknown/Install/Remove/Purge/Hold | |
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend | |
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) | |
||/ Name Version Description | |
+++-=============================================================-=========================================-======================================================= | |
ii ack-grep 1.80-1 A grep-like program specifically for large source trees | |
ii acl 2.2.47-2 Access control list utilities | |
ii acpi-support 0.121 scripts for handling many ACPI events | |
ii acpid 1.0.6-9ubuntu4.9.04.3 |
OlderNewer