Skip to content

Instantly share code, notes, and snippets.


Tahir H. Butt majorgreys

View GitHub Profile
tuxedocat / City Lights.itermcolors
Created Dec 28, 2018 with BG-color changed back to the original city-lights theme.
View City Lights.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
aparrish / understanding-word-vectors.ipynb
Last active May 26, 2022
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0, other text released under CC BY 4.0
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
andersjohansson / emacs-zotero-bib-fetch.el
Created Mar 31, 2016
Emacs-zotero-bib-fetch: fork of zotelo to use better-bibtex's pull export
View emacs-zotero-bib-fetch.el
;;; emacs-zotero-bib-fetch.el --- Manage Zotero collections from emacs
;; Filename: emacs-zotero-bib-fetch.el
;; Author: Anders Johansson, based on zotelo by Spinu Vitalie
;; Maintainer: Anders Johansson
;; Copyright (C) 2011-2014, Anders Johansson and Spinu Vitalie
;; Created: 1 Jul 2014
;; Version: 1.2
;; URL:
;; Keywords: zotero, emacs, reftex, bibtex, bibliography manager
dannguyen /
Last active Apr 29, 2022
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

dannguyen /
Last active Nov 23, 2020
Transcribing ProPublica podcast with Python and Watson Speech to Text API

Using IBM Watson Speech to Text API to translate a ProPublica podcast

An example of using the Watson Speech to Text API to translate a podcast from ProPublica: How a Reporter Pierced the Hype Behind Theranos

This is just a simpler demo of the same technique I demonstrate to make automated video supercuts in this repo:

The transcription takes just a few minutes (less if you parallelize the requests to IBM) and is free...but it isn't perfect by any means. It doesn't fare super well on proper nouns:

  • Charles Ornstein's last name is transcribed as Orenstein
  • John Carreyrou's last name becomes John Kerry Roo
tadly /
Last active Mar 5, 2022
A simple shell script to quickly / easily install "pacaur" on archlinux
# !!! IMPORTANT !!!
# As of 2017-12-14, pacaur is unmaintained (
# For alternatives see the arch wiki:
# pacaur seems to get occasional updates to fix breaking changes due to pacman updates though.
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
tylerwillingham /
Last active Sep 14, 2016
PuPHPet: Craft CMS VM

PuPHPet for Craft Development

I wanted to get a VM configured quickly for building Craft sites, this is what I did:

Deploy Target: Local VM

I want a local VM working with Vagrant + VirtualBox.

Local VM Details

pascalpoitras /
Last active May 27, 2022
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 3.6-dev

Enable mouse

/mouse enable

Secured data

tonyc / gist:1384523
Last active May 17, 2022
Using strace and lsof
View gist:1384523

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)