Skip to content

Instantly share code, notes, and snippets.

View kwcto's full-sized avatar

Will Sahatdjian kwcto

View GitHub Profile
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@robhrt7
robhrt7 / devshelf.sh
Last active August 7, 2021 21:06
Ubuntu init.d service example for nodeJS app with forever
#!/bin/bash
#
# description: DevShelf service
# processname: node
# pidfile: /var/run/devshelf.pid
# logfile: /var/log/devshelf.log
#
# Based on https://gist.github.com/jinze/3748766
#
# To use it as service on Ubuntu:
import cv2
import numpy as np
canny = rho = threshold = minLen = maxGap = None
def draw():
lines = cv2.HoughLinesP(canny, rho, np.pi / 180,
threshold, None, minLen, maxGap)
dst = cv2.cvtColor(canny, cv2.COLOR_GRAY2BGR)
@dcloud
dcloud / 990-p2.html
Created February 23, 2014 15:52
hOCR output for a single page using tesseract on images extracted from pdfs using poppler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='ocr-system' content='tesseract 3.02.02' />
<meta name='ocr-capabilities' content='ocr_page ocr_carea ocr_par ocr_line ocrx_word'/>
</head>
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.counties {
fill: none;
}
.states {
fill: none;
@mbostock
mbostock / .block
Last active May 15, 2019 17:47
Border Distance
license: gpl-3.0
@mbostock
mbostock / .block
Last active September 5, 2019 19:09
Paint by Numbers
license: gpl-3.0
@gianpaj
gianpaj / iterm-automation.sh
Created May 14, 2014 23:30
Automate opening of new tabs in iTerm/Terminal and start command or daemon
#!/bin/bash
echo
echo "Opening project services in a new iTerm window"
osascript <<EOD
launch "iTerm"
tell application "iTerm"
activate
set myterm to (make new terminal)

This Gist contains the script and generated output file for an Acer B276HUL.

The pre-generated file below is known to work with:

  • OS X Mavericks
  • OS X Yosemite
  • OS X El Capitan

For El Capitan:

  1. Restart your Mac while holding Command-R: this puts your Mac into Recovery Mode.
@derhuerst
derhuerst / EventEmitter.coffee
Last active October 26, 2017 06:36 — forked from yocontra/EventEmitter.coffee
A minimalistic CoffeeScript event emitter.
# A minimalistic CoffeeScript event emitter.
# Jannis R <[email protected]>
# https://gist.github.com/derhuerst/5433f5ee3342a1de6d81
class EventEmitter
constructor: ->
@_events = {}