Skip to content

Instantly share code, notes, and snippets.

I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
adventure.
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
@steven2358
steven2358 / ffmpeg.md
Last active October 27, 2025 18:19
FFmpeg cheat sheet
@lgg
lgg / keepass-file-format-explained.md
Last active October 19, 2025 16:10
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.

@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@mechcozmo
mechcozmo / IAM Permissions List.md
Last active May 8, 2025 04:36
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
@dannguyen
dannguyen / README.md
Last active July 29, 2025 14:26
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

@reneviering
reneviering / redux-mocha.js
Created February 5, 2016 19:53
Simple redux todo implementation with mocha tests
var expect = require('chai').expect;
// store
const createStore = (reducer) => {
let listeners = [];
let state;
const getState = () => state;
const subscribe = (listener) => {
@krak3n
krak3n / gist:9fa1268ee0a92a67f71a
Created July 4, 2014 13:38
Avoid DetachedInstanceError in Flask-SQLAlchemy
# The following produces DetachedInstanceError
app = Flask(__name__)
db = SQLAlchemy(app)
class Foo(db.Model):
id = db.Column(db.Integer, primary_key=True)
foo = Foo()
db.session.add(foo)
@rene-armida
rene-armida / paste_wsgi_example.py
Created September 26, 2012 07:16
Example Paste/WebOb/Routes WSGI app
'''
A minimal example of how to use Paste and WebOb to build a custom
WSGI app and serve it.
Depends on:
* paste - http://pypi.python.org/pypi/Paste
* webob - http://pypi.python.org/pypi/WebOb/1.1.1
* routes - http://pypi.python.org/pypi/Routes/1.12.3
I (marmida) still think this is less appropriate than using CouchDB; you'll need