Skip to content

Instantly share code, notes, and snippets.

@prestontimmons
prestontimmons / Manifest.in
Created May 8, 2012 15:25
Minimal setup.py file
include README.md
global-include *.html
global-include *.js
global-include *.css
global-include *.json
global-include *.txt
global-include *.sql
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 20, 2024 16:44
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
@dannguyen
dannguyen / README.md
Last active July 6, 2024 16:36
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

'''
Command line tool that takes a csv as input and exports
a statistical summary of the data points in html format.
'''
import pandas as pd
import pandas_profiling
import argparse
import os
@mattpap
mattpap / conway.py
Created May 2, 2016 14:39
Game of life in bokeh
# Run `bin/bokeh serve` and in a new terminal run `python conway.py`.
# Based on https://github.com/thearn/game-of-life.
from bokeh.plotting import figure, curdoc
from bokeh.client import push_session
from numpy.fft import fft2, ifft2, fftshift
import numpy as np
def fft_convolve2d(x,y):
@scott-maddox
scott-maddox / showbest.js
Last active July 8, 2017 13:51 — forked from thexa4/showbest.js
For use with spaceplan
// Paste in console
var getThings = function(){
var divs = [...document.querySelectorAll("#manufacture__container > div")]
var things = divs.map(function(e){
var result = {e};
var spans = [...e.getElementsByTagName("span")]
spans.map(function(s){
var str = s.innerText.replace(/[^/.0-9]/g, '');
var a = str.split("/");
var num = +a[0];
@pikesley
pikesley / README.md
Created October 22, 2016 15:55
Pivertise your Pi

How to Pivertise your Pi

You know how sometimes you connect your Raspberry Pi to a wifi network and then you have absolutely no way of finding out its IP address (Zeroes are particularly bad for this)? Well, I fixed it. Paste the run-once-at-boot-time systemd script into /etc/systemd/system/pivertiser.service and enable it with sudo systemctl enable pivertiser.service, paste the terrible bash hack into /home/pi/pivertiser.sh and chmod +x /home/pi/pivertiser.sh, then reboot your pi and it should show its face over here

Those addresses are stored in a hash keyed on hostname, so clearly if you never rename your pi from raspberrypi then this is an astonishingly terrible solution, but it's just solved a little problem for me. And you can of course run your own instance on Heroku if you want to

@5agado
5agado / Pandas and Seaborn.ipynb
Created February 20, 2017 13:33
Data Manipulation and Visualization with Pandas and Seaborn — A Practical Introduction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.