Skip to content

Instantly share code, notes, and snippets.

View ww9's full-sized avatar
When everything hangs on a single moment, be sure you choose the right moment.

ww9

When everything hangs on a single moment, be sure you choose the right moment.
View GitHub Profile
@ww9
ww9 / gui_apps_using_go_html_js_css.md
Last active September 1, 2020 19:32
Simple GUI example using https://github.com/zserge/lorca. Shows Go<->Js communication. #go

GUI programs using Go and HTML/CSS/JS

Superior to similar solutions. Doesn't use electron or cgo. Easy communication between Go and Js. Can easily use libs like React, Vue and Angular.

This is a demo app using GUI library https://github.com/zserge/lorca which requires only Chrome and might even work with Firefox in the future.

@ww9
ww9 / one-line-text-art-and-emojis_utf8_ascii.txt
Last active November 15, 2024 08:09
Emojis, UTF8, ASCII (one line) #misc
# Collection of one line text art (◕‿◕✿)
Collection of emojis and one line text art like (╯°□°)╯︵ ┻━┻ 🤗
ּבּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
@ww9
ww9 / gist_blog.md
Last active November 2, 2024 14:04
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
@ww9
ww9 / public_domain_software.md
Last active February 6, 2024 03:42
Public Domain Software #blog

TLDR

Public Domain is not a license and isn't legally accepted in some countries. So if you want to give stuff for free, it's better to just license it under MIT or BSD.

Public Domain Software

The term “public domain” refers to creative materials that are not protected by intellectual property laws such as copyright, trademark, or patent laws. The public owns these works, not an individual author or artist. Anyone can use a public domain work without obtaining permission, but no one can ever own it. - Stanford University definition

Can Cannot
@ww9
ww9 / gist_markdown_examples.md
Last active November 1, 2024 11:49
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@ww9
ww9 / _vanilla_go_web_server.md
Last active November 22, 2020 00:43 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies

Go vanilla web server

Go web server with logging, tracing, health check, graceful shutdown and zero dependencies.

@ww9
ww9 / go_type_assertion_is_fast.md
Created November 17, 2018 22:36
Benchmark showing that type assertion in Go is pretty fast
@ww9
ww9 / context_keys_as_struct_not_int_or_string.md
Last active October 30, 2024 01:55
Why use empty struct{} and not int or string for context.Value() key types in #go

Use struct{} as keys for context.Value() in Go

In the other file of this gist I detail why we should use struct{} as context.Value() keys and not int or string. Open gist to see main.go but the TLDR is:

	type key struct{}
	ctx = context.WithValue(ctx, key{}, "my value") // Set value
	myValue, ok := ctx.Value(key{}).(string) // Get value
@ww9
ww9 / Dockerfile
Last active October 11, 2024 11:53
PDF password bruteforce Python script with Dockerfile
# Usage:
# docker build -t pdftool .
# docker run --rm -it pdftool /bin/bash
# >> python3 pdf-password-bruteforcer.py your_pdf_file.pdf
FROM ubuntu:20.04
# set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

Cracking PDF password with broteforce using Docker + Python

I needed to pay a bill where the barcode was password protected.

I found https://gist.github.com/dhondta/efe84a92e4dfae3b6c14932c73ab2577 but the Dockerfile was broken becuase it used abbandoned CentOS.

So I converted the Dockerfile to Ubuntu and it worked! Took around 20 seconds to crack 3 number password.

Instructions