Skip to content

Instantly share code, notes, and snippets.

View textarcana's full-sized avatar

Noah Sussman textarcana

View GitHub Profile
@textarcana
textarcana / why I love windows.txt
Created February 27, 2009 15:54
Why I love Windows: what changed in my config between the 3 times I invoked this command? NOTHING <insert insane laughter>
c:\noah\n_s\config\emacs>svn ci -m "fixing insane semicolons in both my PC emacs config files. Comments really need to be cleaned up." .
6521 [main] svn 5448 fhandler_console::fixup_after_fork_exec: error opening input console handle for /dev/console after fork/exec, errno 13, Win3
2 error 5
11294 [main] svn 5448 fhandler_console::fixup_after_fork_exec: error opening output console handle for /dev/console after fork/exec, errno 13, Win
32 error 5
18275 [main] svn 5448 fhandler_console::fixup_after_fork_exec: error opening input console handle for /dev/console after fork/exec, errno 13, Win3
2 error 5
23035 [main] svn 5448 fhandler_console::fixup_after_fork_exec: error opening output console handle for /dev/console after fork/exec, errno 13, Win
32 error 5
29676 [main] svn 5448 fhandler_console::fixup_after_fork_exec: error opening input console handle for /dev/console after fork/exec, errno 13, Win3
#!/usr/bin/perl
# -w switch is off bc HERE docs cause erroneous messages to be displayed under Cygwin
#From the Perl Cookbook, Ch. 9.9
# rename - Larry's filename fixer
$help = <<EOF;
Usage: rename expr [files]
This script's first argument is Perl code that alters the filename (stored in \$_ ) to reflect how you want the file renamed. It can do this because it uses an eval to do the hard work. It also skips rename calls when the filename is untouched. This lets you simply use wildcards like rename EXPR * instead of making long lists of filenames.
Here are five examples of calling the rename program from your shell:
@textarcana
textarcana / gist:80081
Created March 16, 2009 21:12
JSON format used by the New York Times Article Skimmer
{
"channel": {
"items": [
{
"title":"Madoff’s Bail Revoked After Guilty Pleas to All Charges",
"link":"http://www.nytimes.com/2009/03/13/business/13madoff.html?partner=rss&emc=rss",
"description":"Bernard L. Madoff was sent to jail to await sentencing on Thursday after expressing remorse for running a vast Ponzi scheme.",
;; Paste directly to a github gist
(load-file "~/Documents/n_s/config/emacs/site-lisp-textarcana/gist.el")
require 'iconv'
# assume windoze_str is a string that contains curly quotes or other windows extended characters
conv = Iconv.new('ASCII//IGNORE//TRANSLIT', 'UTF-8')
# remove MS Word curly quotes and other Windows extended character crap
unicode_str = conv.iconv windoze_str
namespace :rdoc do
desc "Generate RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
task :generate do
puts "Generating RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
`rdoc --exclude restful_authentication -o zepdocs ; open zepdocs/index.html`
puts "DONE!"
end
desc "Remove old docs and regenerate RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
@textarcana
textarcana / gist:81210
Created March 18, 2009 15:49 — forked from oddlyzen/gist:81195
rake task to build documentation
namespace :rdoc do
desc "Generate RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
task :generate do
puts "Generating RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
`rdoc --exclude restful_authentication -o zepdocs ; open zepdocs/index.html`
puts "DONE!"
end
desc "Remove old docs and regenerate RDocs for ZepInvest (exluding RESTful Authentication Plugin)"
JavaScript - http://prototype.nytimes.com/gst/articleSkimmer/
* Collapse All
* Expand All
http://prototype.nytimes.com/gst/articleSkimmer/
http://graphics8.nytimes.com/js/app/articleSkimmer/jquery.min.js
/*
* jQuery JavaScript Library v1.3.1
# for multiline ruby statements in haml...
= { :foo => :bar, |
:baz => :foo, |
:quux => :zz}.inspect |
# the magical 'pipe' strikes again.
Mar22 10:01:13 tools>perl net-irc.pl
:calvino.freenode.net 328 zepguest #zepinvest :http://wiki.dev.zepinvest.com/wiki/index.php?title=IRC
:isnull!n=user@cpe-66-108-139-127.nyc.res.rr.com PRIVMSG #zepinvest :zepguest: A program is never less than 90% complete, and never more than 95% complete. -- Terry Baker
:freenode-connect!freenode@freenode/bot/connect PRIVMSG zepguest :VERSION
:isnull!n=user@cpe-66-108-139-127.nyc.res.rr.com PRIVMSG #zepinvest :ACTION waves to zepguest
:isnull!n=user@cpe-66-108-139-127.nyc.res.rr.com PRIVMSG #zepinvest :hello robot
:isnull!n=user@cpe-66-108-139-127.nyc.res.rr.com PRIVMSG #zepinvest :sweet, its a logbot