Skip to content

Instantly share code, notes, and snippets.

View colinmford's full-sized avatar

Colin M. Ford colinmford

View GitHub Profile
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@ndarville
ndarville / business-models.md
Last active October 23, 2024 17:18
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@okay-type
okay-type / MetricsAdj.py
Last active December 21, 2015 23:18
Metrics Adjuster
# [email protected]
### requires an icon file toolGoMetrics.pdf in the same folder
# download it from www.theharrietseries.com/crypt/robofont/toolGoMetrics.pdf
### updated 2013/03/10 — linked to didfontopen observers, just set as a startup script
### updated 2013/07/16 — fixed lame selection traceback and broken spacecenter adjustments
# to do: adjust by percent, uniform adjust, remember last setting
import os
from vanilla import *
from mojo.UI import CurrentFontWindow, CurrentSpaceCenter
@okay-type
okay-type / Ventriloquist.py
Last active May 5, 2018 11:48
Ventriloquist: insert a dummy dsig table (with serials)
# Ventriloquist - Build 0.1
# insert a dummy dsig table with unique numbers into .otf fonts
# the idea is to kill two birds with one stone
# this idea needs lots of testing
# to do: add SerialDump[] to a txt file for record keeping
#
# [email protected]
from fontTools.ttLib import TTFont
from mojo.compile import *
@okay-type
okay-type / aPreviewer.py
Last active August 29, 2015 14:03
aPreviewer.py for Robofont, show the current glyph big and small as a simple alternative to looking at drawings in space center.
# jackson @ okaytype.com
# simpler big glyph preview window v3
from vanilla import Window
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo import events
from mojo.events import addObserver, removeObserver
from mojo.glyphPreview import GlyphPreview
class BigGlyphPreview(BaseWindowController):
@gumblex
gumblex / PathFitter.py
Created April 4, 2015 12:01
Path fitter in Python - An Algorithm for Automatically Fitting Digitized Curves
"""
Ported from Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
http://paperjs.org/
Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
http://scratchdisk.com/ & http://jonathanpuckey.com/
Distributed under the MIT license. See LICENSE file for details.
All rights reserved.
@dannguyen
dannguyen / README.md
Last active September 10, 2024 19:41
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

# Robofont script to remove broken image paths, keeping good ones intact.
import os
f = CurrentFont()
layerOrder = ['foreground']
layerOrder.extend(f.layerOrder)
for g in f:
for layerName in layerOrder:
layeredGlyph = g.getLayer(layerName)
@prateekchandrayan
prateekchandrayan / MNISTwithKeras.py
Last active June 17, 2021 07:10
MNIST prediction using Keras and building CNN from scratch in Keras
#Step 1
import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
from tqdm import tqdm # a nice pretty percentage bar for tasks. Thanks to viewer Daniel BA1/4hler for this suggestion
import tensorflow as tf #Import Tensorflow
import glob #This will extract all files from the folder
import keras
from keras.preprocessing.image import ImageDataGenerator
@simoncozens
simoncozens / HTKerner.py
Created February 1, 2019 15:42
HT LetterKerner, first draft
#MenuTitle: HT LetterKerner
# Put this in your HTLetterSpacer script directory so it can find
# the library.
# Todo:
# Does not handle whole-font yet.
# Does not know or care about kerning groups.
# The reference glyph should be adjusted based on the letter pair
# - "n" works well for lowercase-lowercase