Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@azaroth42
azaroth42 / info.json
Last active October 15, 2016 00:34
Ultra simple AV info.json
{
"@context": "http://iiif.io/api/av/0/context.json",
"id": "https://iiif-staging02.lib.ncsu.edu/iiifv/pets",
"profile": "http://iiif.io/api/av/0/level1.json",
"attribution": "Provided by NCSU",
"logo": "http://ncsu.edu/logo.png",
"rights": "http://creativecommons.org/4.0/cc-by/",
"sizes": [
@benjie
benjie / README.md
Last active January 17, 2023 15:16
Long Live CoffeeScript and Long Live ES6

Long Live CoffeeScript and Long Live ES6

Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.

Classes

Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

@mintuhouse
mintuhouse / net_ldap_overrides.rb
Created April 2, 2014 10:51
Verify the certificate of secure LDAP server using net-ldap ruby gem
class Net::LDAP
def initialize(args = {})
@host = args[:host] || DefaultHost
@port = args[:port] || DefaultPort
@verbose = false # Make this configurable with a switch on the class.
@auth = args[:auth] || DefaultAuth
@base = args[:base] || DefaultTreebase
encryption args[:encryption] # may be nil
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@niklasl
niklasl / rdfa_prototypes.html
Created December 9, 2012 08:52
HTML5+RDFa version of <http://d.lib.ncsu.edu/collections/catalog/mc00096-001-ff0155-000-001_0001> using experimental RDFa prototypes
<!DOCTYPE html>
<html>
<head>
<base href="http://d.lib.ncsu.edu/collections/catalog/mc00096-001-ff0155-000-001_0001" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width; initial-scale=1.0">
@pristinenoise
pristinenoise / blacklight_google_analytics.rb
Created April 9, 2012 15:12
changing to environment friendly
# Change to your Google Web id
BlacklightGoogleAnalytics.web_property_id = case Rails.env.to_s
when 'development'
'UA-3-1'
when 'test'
nil
else
'UA-2-1'
end
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
@simi
simi / Gemfile
Created February 7, 2012 14:32
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@cjweeg
cjweeg / "BagIt" error finder
Created December 20, 2011 20:31
Looks through a "BagIt" Missing-Files-manifest and locates lines where the string "._" does not occur
#!/usr/bin/env ruby
# ARGV[0] should point to the directory where the "BagIt" text file is stored
if !ARGV[0]
puts "You must specify the directory \"BagIt\" text file is stored. Try again!"
exit
end
# first we find the full path of the argument in case we're only given