Skip to content

Instantly share code, notes, and snippets.

View webdevbyjoss's full-sized avatar

Joe Chereshnovsky webdevbyjoss

View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@webdevbyjoss
webdevbyjoss / gist:4045634
Created November 9, 2012 13:19
Render error messages of Backbone.Validation for Twitter Bootstrap
// Original CoffeScript gist can be found here: https://gist.github.com/2909552 (credits to the author)
// I just translated it to JavaScript for my own needs using Coffeescript to Javascript translator
_.extend(Backbone.Validation.callbacks, {
valid: function(view, attr, selector) {
var control, group;
control = view.$('[' + selector + '=' + attr + ']');
group = control.parents(".control-group");
group.removeClass("error");
if (control.data("error-style") === "tooltip") {
@tknerr
tknerr / README.md
Last active January 23, 2024 16:42
Vagrant with Ansible Provisioner on Windows

Vagrant with Ansible Provisioner on Windows

Long story short, ansible does not work on a Windows control machine, so you basically have to:

  • either run ansible --connection=local ... in the target vm
  • set up a separate control vm where ansible is installed via shell provisioner

Below are Vagrantfile examples for both approaches

Within the Target VM

@olegkovalenko
olegkovalenko / crontab.Doq5oJsuSd
Created May 26, 2015 14:31
contab fintess lifehack
*/30 9-17 * * 1-5 say "Stand up and walk around"
@joepie91
joepie91 / vpn.md
Last active July 1, 2024 18:03
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@dannguyen
dannguyen / README.md
Last active May 17, 2024 02:07
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

@eyecatchup
eyecatchup / node-cms.md
Last active February 26, 2023 07:47
[WIP] List of Node-based content management systems (CMS)