TODO: Write a project description
TODO: Describe the installation process
/** | |
* Polyfill for "fixing" IE's lack of support (IE < 9) for applying slice | |
* on host objects like NamedNodeMap, NodeList, and HTMLCollection | |
* (technically, since host objects are implementation-dependent, | |
* IE doesn't need to work this way). Also works on strings, | |
* fixes IE to allow an explicit undefined for the 2nd argument | |
* (as in Firefox), and prevents errors when called on other | |
* DOM objects. | |
* @license MIT, GPL, do whatever you want | |
-* @see https://gist.github.com/brettz9/6093105 |
/** | |
* Creates a new Uint8Array based on two different ArrayBuffers | |
* | |
* @private | |
* @param {ArrayBuffers} buffer1 The first buffer. | |
* @param {ArrayBuffers} buffer2 The second buffer. | |
* @return {ArrayBuffers} The new ArrayBuffer created out of the two. | |
*/ | |
var _appendBuffer = function(buffer1, buffer2) { | |
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); |
function toLocalISOString(d) { | |
var off = d.getTimezoneOffset(); | |
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes() - off, d.getSeconds(), d.getMilliseconds()).toISOString(); | |
} |
/** γ«γΏγ«γγγ²γγγͺγ«ε€ζγγι’ζ° | |
* @param {String} src - γ«γΏγ«γ | |
* @returns {String} - γ²γγγͺ | |
*/ | |
function katakanaToHiragana(src) { | |
return src.replace(/[\u30a1-\u30f6]/g, function(match) { | |
var chr = match.charCodeAt(0) - 0x60; | |
return String.fromCharCode(chr); | |
}); |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multiβfile gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
#! /bin/bash | |
# build the environment | |
mkdir tessenv; cd tessenv | |
TROOT=`pwd` | |
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng | |
echo "Environment built" | |
# Get the stock english fonts from Google (old, but they work) | |
cd $TROOT/stockfonts | |
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz |
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
// ==UserScript== | |
// @version 1.4.1 | |
// @name Hide watched videos on YouTube | |
// @icon https://www.youtube.com/favicon.ico | |
// @match https://www.youtube.com/* | |
// @exclude https://www.youtube.com/embed/* | |
// @exclude https://www.youtube.com/api/* | |
// @namespace https://gist.github.com/xPaw/6324624 | |
// @updateURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js | |
// @downloadURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js |
from __future__ import division | |
from itertools import * | |
from pylab import * | |
from nltk.corpus import brown | |
from string import lower | |
from collections import Counter | |
# The data: token counts from the Brown corpus | |
tokens_with_count = Counter(imap(lower, brown.words())) |