Skip to content

Instantly share code, notes, and snippets.

View Mparaiso's full-sized avatar

mparaiso Mparaiso

View GitHub Profile
@jboner
jboner / latency.txt
Last active April 18, 2024 17:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@iambibhas
iambibhas / scopes.txt
Last active April 8, 2024 20:37
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@posener
posener / go-kit.md
Last active February 23, 2024 21:35
Why I Recommend to Avoid Using the go-kit Library

Why I Recommend to Avoid Using the go-kit Library

There is a trending 'microservice' library called go-kit. I've been using the go-kit library for a while now. The library provide a lot of convenience integrations that you might need in your service: with service discovery with Consul, distributed tracing with Zipkin, for example, and nice logic utilities such as round robin client side load balancing, and circuit breaking. It is also providing a way to implement communication layer, with support of RPC and REST.

@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@joyrexus
joyrexus / README.md
Last active January 20, 2024 22:01
nested templates in go

Example of nested templates.

Given this file layout ...

.
├── server.go
└── templates
    ├── profiles.html
    └── layout.html
@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

@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@nathan-osman
nathan-osman / win32.go
Last active August 31, 2023 22:01
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")