Skip to content

Instantly share code, notes, and snippets.

View T1T4N's full-sized avatar
👽

Robert Armenski T1T4N

👽
View GitHub Profile
@T1T4N
T1T4N / lna.sh
Created January 26, 2016 09:13
Create symlinks of all files and folders from the source dir to the destination dir
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Create symlinks of all files and folders from the source dir to the destination dir"
echo "Usage: `basename $0` source [dest]"
exit 1
fi
source=$1
@T1T4N
T1T4N / _bootstrap_xl.scss
Created March 11, 2016 14:22
A SASS stylesheet that adds a xl-column to the bootstrap grid system
@import "bootstrap";
// XLarge screen / wide desktop
//** Deprecated `$screen-xl` as of v3.0.1
$screen-xl: 1600px !default;
$screen-xl-min: $screen-xl !default;
$screen-xl-desktop: $screen-xl-min !default;
// So media queries don't overlap when required, provide a maximum
$screen-lg-max: ($screen-xl-min - 1) !default;
@T1T4N
T1T4N / bootstrap_custom_column.md
Last active March 11, 2016 14:34
Guide to create custom columns for the bootstrap grid system

Original post: Bootstrap 3: adding a new set of columns

Notice that Bootstrap's CSS uses a mobile first strategy, so it is important to define your xxs-grid (I should choose an other name) between the xs-grid and the sm-grid. See also: Bootstrap 3 mixin multiple make-*-column. For that reason you can not use the Less code from this question Bootstrap 3 extra large (xl) columns

  1. Download the Bootstrap source code at: http://getbootstrap.com/getting-started/
  2. In less/variables.less add:
    // horizontal mobiles
    
@T1T4N
T1T4N / README.md
Created March 24, 2016 19:54 — forked from dannguyen/README.md
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using 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

@T1T4N
T1T4N / installation.md
Created April 18, 2016 19:12 — forked from guillaumevincent/installation.md
A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv

Description

A simple guide to install PyQt5 on Mac OS X 10.9 (Maverick) and use python 3.4 on a virtualenv.

Requirements

  • xcode 5.1.1
  • python 3.4.0
  • Qt libraries 5.2.1
@T1T4N
T1T4N / gist:6bfc5055f9c7838d50845351b6980875
Created April 28, 2016 00:59 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@T1T4N
T1T4N / multi_plot.py
Created May 8, 2016 23:55
cvShowManyImages in Python - A basic replacement for matplotlib.pyplot
import cv2
import numpy as np
def multi_plot(height, width, rows, cols, images, titles,
title_color=(255, 255, 255), center_title=False,
background_color=(0, 0, 0),
padding=10, centered=True, borders=False, border_color=(0, 255, 0)):
"""
Plot the specified images with the specified titles in a matrix of images
@T1T4N
T1T4N / ThreadWebcamCapture.py
Created July 27, 2016 14:27
OpenCV webcam capture in a separate thread
class WebcamVideoStream:
def __init__(self, src=0):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
(self.grabbed, self.frame) = self.stream.read()
# initialize the variable used to indicate if the thread should
# be stopped
self.stopped = False

Keybase proof

I hereby claim:

  • I am T1T4N on github.
  • I am t1t4n (https://keybase.io/t1t4n) on keybase.
  • I have a public key whose fingerprint is 2A77 331B 777B BBCC 4E15 7229 D2E1 531D 5AFD EF24

To claim this, I am signing this object:

@T1T4N
T1T4N / WoW64_call.cpp
Created October 17, 2016 00:03 — forked from Cr4sh/WoW64_call.cpp
WoW64 Heaven's Gate
#include "stdafx.h"
#define DB(_val_) __asm __emit (_val_)
#define INVALID_SYSCALL (DWORD)(-1)
// code selectors
#define CS_32 0x23
#define CS_64 0x33