Skip to content

Instantly share code, notes, and snippets.

View kpavlovsky's full-sized avatar
😀

Kostja P kpavlovsky

😀
  • Europe
View GitHub Profile
@StefanNieuwenhuis
StefanNieuwenhuis / reactiveconf-framework-independent-components-library-with-StencilJS.md
Last active September 23, 2020 12:55
How to build a framework independent component library with StencilJS

How to build a framework independent component library with StencilJS

This is a proposal for a lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal! If you're on your phone, please request the 🖥 desktop site to star this gist 😇 #ReactiveConf

@kracekumar
kracekumar / ws_app.py
Last active September 5, 2024 17:04
Simple websocket server with uvloop.
# -*- coding: utf-8 -*-
import asyncio
import uvloop
from aiohttp.web import Application, MsgType, WebSocketResponse
def add_socket(app, socket, user_id):
if user_id in app['connections']:
pass
@dannguyen
dannguyen / README.md
Last active September 10, 2024 19:41
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

@nepsilon
nepsilon / how-to-bash-batch-rename.md
Last active July 7, 2016 06:15
How to batch rename files with bash? — First published in fullweb.io issue #36

How to batch rename files with bash?

Let’s say we have these files:

ls 
to_be_renamed_1.txt 
to_be_renamed_2.txt 
to_be_renamed_3.txt 
@nepsilon
nepsilon / how-to-debug-python-pdb.md
Last active July 8, 2016 06:12
How to debug Python programs? — First published in fullweb.io issue #35

How to debug Python programs?

When we can’t understand the execution path or behaviour of our program we better use a debugger. Python offers pdb, a full featured debugger. Here is how to get started.

Import it with:

import pdb 
@bishboria
bishboria / springer-free-maths-books.md
Last active October 3, 2024 09:17
Springer made a bunch of books available for free, these were the direct links
@Chandler
Chandler / slack_history.py
Last active July 18, 2024 04:21
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
Top section is for regular Ubuntu installs. Bottom section is for EC2 installs.
Ubuntu Login as Root (regular Ubuntu VM or PC – not using AWS EC2)
Login with main user
Now gain root access to bash, by emulating it with sudo
# sudo -i
@omegahm
omegahm / create_labels.sh
Created April 7, 2015 19:00
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
class ExampleFormMultipleView(MultipleFormsView):
template_name = 'preferences/change_group_multiple.html'
forms = {
'profile': ProfileForm,
'avatar': AvatarForm,
'contacts': ContactsForm,
}
def forms_valid(self, forms):
for key, form in forms.items():