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 "formula" | |
class Tesseract < Formula | |
homepage 'http://code.google.com/p/tesseract-ocr/' | |
url 'https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz' | |
sha1 'a950acf7b75cf851de2de787e9abb62c58ca1827' | |
revision 2 | |
bottle do | |
sha1 "5949807031e5d1a5c4382ed93afa06e684be104f" => :mavericks |
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
var Temperature = Backbone.Model.extend({ | |
defaults: { | |
celsius: 0 | |
}, | |
fahrenheit: function(value) { | |
if (typeof value == 'undefined') { | |
return this.c2f(this.get('celsius')); | |
} | |
value = parseFloat(value); | |
this.set('celsius', this.f2c(value)); |
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
# Git comes with some shell scripts you can load to get | |
# nifty shell features. Homebrew sticks them in /usr/local/etc/bash_completion.d | |
source "/usr/local/etc/bash_completion.d/git-prompt.sh" | |
source "/usr/local/etc/bash_completion.d/git-completion.bash" | |
# apparently you can specify __git_ps1 as the thing that | |
# renders your prompt by setting PROMPT_COMMAND. | |
# Setting the PROMPT_COMMAND lets git display colors. | |
# | |
# The alternative is just to set the PS1 variable. | |
# |
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
# Make sure we've got readline on ubuntu | |
sudo apt-get install libreadline-dev | |
# copied from https://github.com/postmodern/ruby-install | |
wget -O ruby-install-0.3.2.tar.gz https://github.com/postmodern/ruby-install/archive/v0.3.2.tar.gz | |
# might be worth checking the gpg signature of the file you're installing per | |
# postmodern's instructions. Install his key from here: http://postmodern.github.io/contact.html#pgp | |
# and then uncomment the lines below. |
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 'graphicsmagick' | |
size_strings = %w( | |
120x240 | |
120x60 | |
120x600 | |
120x90 | |
125x125 | |
160x600 | |
180x150 |
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
documents = Document.all(:limit=>10) # get some documents | |
# use map to iterate over the documents & return the percentage | |
# of the document's words that are in the spell check dictionary | |
results = documents.map do |doc| | |
checked = Spellchecker.check(doc.combined_page_text) # check the text | |
correct = checked.select{ |entry| entry[:correct] } # get the correct words | |
percentage = correct.size.to_f / checked.size # find the percentage | |
puts "#{doc.id}: #{percentage} (#{correct.size} of #{checked.size})" # print out some status info. | |
[doc.id, {:percent => percentage, :correct => correct.size, :checked => checked.size}] # return the document's id, and it's percentage |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Apr 18 13:10:10 2013 | |
@author: Owner | |
""" | |
import sys | |
import csv | |
import time |
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
ted ⮀ mwc-146031 ⮀ ~ ⮁ Downloads ⮀ $ ⮀file jashkenas-coffee-script-1.5.0-0-gaf53c23.tar.gz | |
jashkenas-coffee-script-1.5.0-0-gaf53c23.tar.gz: gzip compressed data, from Unix | |
ted ⮀ mwc-146031 ⮀ ~ ⮁ Downloads ⮀ $ ⮀file spa.traineddata.gz | |
spa.traineddata.gz: gzip compressed data, was "spa.traineddata", from Unix, last modified: Thu Sep 30 17:08:52 2010 | |
ted ⮀ mwc-146031 ⮀ ~ ⮁ Downloads ⮀ $ ⮀file --mime-type jashkenas-coffee-script-1.5.0-0-gaf53c23.tar.gz | |
jashkenas-coffee-script-1.5.0-0-gaf53c23.tar.gz: application/x-gzip | |
ted ⮀ mwc-146031 ⮀ ~ ⮁ Downloads ⮀ $ ⮀file --mime-type spa.traineddata.gz | |
spa.traineddata.gz: application/x-gzip |
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
// Fetch and append the current temperature | |
function fetchAndAppendWeather() { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getActiveSheet(); | |
// All the actual work is done in the top row. | |
// We get the link stored in cell A1 | |
var weatherLink = sheet.getRange("A1").getValue(); | |
// we set a formula importing a targeted portion of the web page |
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
[2/18/13 11:49:45 AM] schwaumlaut: I don't know regular expressions. :P | |
[2/18/13 11:49:57 AM] Ted Han: L2REGEXP | |
[2/18/13 11:49:59 AM] Ted Han: n00b | |
[2/18/13 11:50:01 AM] schwaumlaut: What is a good thing to read for them? | |
[2/18/13 11:50:09 AM] Ted Han: http://rubular.com/ is fun. | |
[2/18/13 11:50:45 AM] schwaumlaut: "I would like to learn to program." | |
"Here is your command line. ENJOY!" | |
[2/18/13 11:50:52 AM] Ted Han: haha. | |
[2/18/13 11:51:17 AM] Ted Han: http://docs.python.org/2/howto/regex.html ? | |
[2/18/13 11:51:19 AM] Ted Han: here's the basic gist |