Skip to content

Instantly share code, notes, and snippets.

View ryanfb's full-sized avatar

Ryan Baumann ryanfb

View GitHub Profile
@ryanfb
ryanfb / ecodices-dl.rb
Last active December 23, 2015 00:29
e-codices downloader - http://www.e-codices.unifr.ch/
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
def download_pages(uri, id)
doc = Nokogiri::HTML(open(uri))
doc.xpath('//select[@id = "page_select"]/option/@value').each do |value|
page = value.to_s.split('/').last
page_uri = "#{uri}/#{page}/x-large"
@ryanfb
ryanfb / config.txt
Created April 29, 2013 14:44
~/.ssh/config
Host *
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto
ControlPersist 3600
@ryanfb
ryanfb / citegop-modified.xsl
Last active December 12, 2015 05:48
Modified citegop.xsl cite:request template for linking from citefusioncoll to a cite-collection-editor instance.
<xsl:template match="cite:request">
<h2>Requested Collection</h2>
<p><xsl:apply-templates select="./cite:urn"/></p>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>http://example.com/cite-collection-editor/index.html#collection=YOURCOLLECTION&amp;URN=</xsl:text><xsl:value-of select="./cite:urn"/></xsl:attribute>
<xsl:attribute name="target"><xsl:text>_blank</xsl:text></xsl:attribute>
<xsl:text>Open in Editor</xsl:text>
</xsl:element>
</xsl:template>
@ryanfb
ryanfb / a.txt
Created October 24, 2012 18:20
Example of using XSugar command line wrappers
ryan@Βρισηΐς:~/source/xsugar[master]$ ~/Downloads/jruby-1.7.0/bin/jruby --1.8 ./bin/xml2nonxml.rb < ~/mess/current/bgu.1.110-edition.xml
<S=.grc<=
1. [.9].4 ἐπι.1[.3].2
2. (|[.8]χυρι̣ο|) πράκτ[ορε]ς
3. $m2 [.?][ Λεωνί]δῃ καὶ Ἑρμογείτ[ονι (γρ(αμματεῦσι))]
4. (μητροπ(όλεως))

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@ryanfb
ryanfb / teem-libpng.patch
Created February 9, 2012 17:57
Patch for teem linking against OS X libpng
diff --git a/src/nrrd/formatPNG.c b/src/nrrd/formatPNG.c
index 75eaa10..564f3af 100644
--- a/src/nrrd/formatPNG.c
+++ b/src/nrrd/formatPNG.c
@@ -120,7 +120,7 @@ _nrrdErrorHandlerPNG (png_structp png, png_const_charp message)
sprintf(err, "%s: PNG error: %s", me, message);
biffAdd(NRRD, err);
/* longjmp back to the setjmp, return 1 */
- longjmp(png->jmpbuf, 1);
+ longjmp(png_jmpbuf(png), 1);
@ryanfb
ryanfb / google.css
Created June 29, 2011 21:43
Hides +1 and instant preview buttons on every search result
button.esw.eswd,
button.vspib,
div#vspb,
div.vspi{ display: none ! important }
@ryanfb
ryanfb / gist:955889
Created May 4, 2011 19:50
automatic git changelog from tags
# major versions only
prever=""; for ver in `git tag | grep -v rc | gsort -V -r`; do if [ "$prever" != "" ]; then echo $prever; git rev-list --pretty=oneline --abbrev-commit --no-merges $prever ^$ver; echo ""; fi; prever=$ver; done | less
# RC's only
prever=""; for ver in `git tag | grep rc | gsort -V -r`; do if [ "$prever" != "" ]; then echo $prever; git rev-list --pretty=oneline --abbrev-commit --no-merges $prever ^$ver; echo ""; fi; prever=$ver; done | less
@ryanfb
ryanfb / gist:550235
Created August 25, 2010 20:33 — forked from leedo/gist:550187
$(BUILD)/alice-%.css: $(CSS_SOURCE)/color/%.scss
cat $< $(ALICE_SCSS) | sass --scss -s $@
COLORFILES := $(foreach dir,$(CSS_SOURCE)/color,$(wildcard $(dir)/*.scss))
CSSFILES := $(addprefix $(BUILD)/alice-,$(notdir $(COLORFILES:.scss=.css)))
stylesheets: $(CSSFILES)
diff --git a/lib/App/Alice/IRC.pm b/lib/App/Alice/IRC.pm
index e5b57a9..0b04a9e 100644
--- a/lib/App/Alice/IRC.pm
+++ b/lib/App/Alice/IRC.pm
@@ -591,7 +591,7 @@ sub nick_avatar {
return "http://www.gravatar.com/avatar/"
. md5_hex($email) . "?s=32&amp;r=x";
}
- elsif ($info->{real} =~ /(https?:\/\/\S+(?:jpe?g|png|gif))/) {
+ elsif ($info->{real} =~ /(https?:\/\/\S+(?:jpe?g|png))/) {