Skip to content

Instantly share code, notes, and snippets.

View jacqui's full-sized avatar

Jacqui Lough jacqui

View GitHub Profile
@jacqui
jacqui / buenos-aires-recommendations.md
Last active July 27, 2017 15:56
places to eat, drink, stuff to do and see in the lovely port city of Buenos Aires

Buenos Aires

Restaurants & Food

  • Famous & fancy: Patagonia Sur
  • Pizzeria Guerrin excellent pizza, maybe the best in the city
  • Some cute cafes, all equally good, nice for breakfast or lunch: Malvon, Oui Oui
  • Historic cafe: Las Violetas
  • STEAK: some good places I've been are:
    • Social la Lechuza - ok, probably not the best steak in town, but for ambiance this place is neat, it's a social club with an owl (la lechuza) theme, walls are covered in customer drawings of, yes, owls. I like the joint.
/*
Example Facebook Messenger app that pulls the user's public profile and echoes back any messages sent
with the user's first and last name.
So if I sent the bot "Good morning!" it will reply to me with "Echoing message from Jeff Israel: Good morning!"
*/
const bodyParser = require('body-parser');
const crypto = require('crypto');
const express = require('express');
@dannguyen
dannguyen / README.md
Last active December 28, 2023 15:21
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

@malev
malev / README.md
Last active August 29, 2015 14:08
Convert CSV files into HTML

CSV to HTML (cli)

Just run:

$ ruby csvtohtml.rb data.csv > table.html

You can customize the table's id, table's classes, header's classes and field's classes. You can also use linux pipes and it's only one small file long with NO dependencies.

Pseudo installation (not needed)

# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@bleything
bleything / homedir.rake
Created January 2, 2013 00:32
Stick this in your homedir repo. Run rake. Watch in amazement as it symlinks everything.
require 'find'
BLACKLIST = %w[
.git
.gitignore
Rakefile
]
task :default do
Find.find('.') do |path|
@thomaspark
thomaspark / subnav.css
Last active June 6, 2023 10:19
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
# In development mode, optionally perform a RubyProf profile of any request.
# Simply pass perform_profile=true in your params.
def perform_profile
return yield unless params[:perform_profile]
require 'ruby-prof'
RubyProf.start
yield
result = RubyProf.stop
printer = RubyProf::FlatPrinter.new(result)
File.open("#{Rails.root}/tmp/profile.txt", 'w+') do |f|
@catwell
catwell / bench.lua
Created October 18, 2011 20:11
Redis Scripting speed
require "redis"
local WMAX = 100000
local rc = Redis.connect("unix:///tmp/redis.sock")
local rs_mhset = [[
local keys,argv,rcall = KEYS,ARGV,redis.call
local n,f = 0,argv[#keys+1]
for i,k in ipairs(keys) do n = n + rcall("hset",k,f,argv[i]) end
return n