Skip to content

Instantly share code, notes, and snippets.

View gungoren's full-sized avatar
💭
lives in the clouds

Mehmet Gungoren gungoren

💭
lives in the clouds
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active July 13, 2024 13:20
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@edoakes
edoakes / monte_carlo_pi.py
Last active May 15, 2024 02:14
Monte Carlo Pi estimation
import argparse
import time
import random
import math
parser = argparse.ArgumentParser(description="Approximate digits of Pi using Monte Carlo simulation.")
parser.add_argument("--num-samples", type=int, default=1000000)
parser.add_argument("--parallel", default=False, action="store_true")
parser.add_argument("--distributed", default=False, action="store_true")
from __future__ import unicode_literals
import base64
from os import path
import io
from io import StringIO
import pymysql
import imaplib
import json
import smtplib,ssl
import urllib.parse
@JakeSteam
JakeSteam / .travis.yml
Last active December 15, 2020 10:27
Creating app bundles and APKs on Travis CI (for https://wp.me/paoKlI-Gk)
# Overall config
dist: xenial
language: android
# Android version config
android:
components:
- build-tools-28.0.3
- android-28
@mikepfeiffer
mikepfeiffer / stress.sh
Created January 27, 2019 21:05
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
@DrSleep
DrSleep / README
Last active August 16, 2020 17:04
KITTI VISUAL ODOMETRY DATASET
## http://cvlibs.net/datasets/kitti/eval_semantics.php
## https://omnomnom.vision.rwth-aachen.de/data/rwth_kitti_semantics_dataset.zip
### DATASET FOR SEMANTIC SEGMENTATION

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@mgoodness
mgoodness / k8s-svc-annotations.md
Last active July 11, 2024 06:17
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@dannguyen
dannguyen / README.md
Last active July 6, 2024 16:36
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

@kaushikgopal
kaushikgopal / pre-commit
Last active April 19, 2023 09:22
pre-commit git hook - no "hacking"
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
def current_branch()
branches = `git branch --no-color`.split(/\n/)