Skip to content

Instantly share code, notes, and snippets.

View miguelff's full-sized avatar

Miguel Fernández miguelff

View GitHub Profile
@miguelff
miguelff / out
Last active March 11, 2024 21:21
Taxes in asturias
Gross: 420000, Net: 220831 (18402 / mo), Tax: 199168 - 47.42 percent goes to taxes
Gross: 245200, Net: 135179 (11264 / mo), Tax: 110020 - 44.87 percent goes to taxes
Gross: 180000, Net: 103231 (8602 / mo), Tax: 76768 - 42.65 percent goes to taxes
Gross: 157700, Net: 92131 (7677 / mo), Tax: 65568 - 41.58 percent goes to taxes
Gross: 113950, Net: 70256 (5854 / mo), Tax: 43693 - 38.34 percent goes to taxes
Gross: 92075, Net: 59318 (4943 / mo), Tax: 32756 - 35.58 percent goes to taxes
Gross: 70200, Net: 47391 (3949 / mo), Tax: 22808 - 32.49 percent goes to taxes
Taxes in bizkaia
@miguelff
miguelff / main.go.diff
Created November 9, 2023 15:33
Channels based linearization
diff --git a/main.go b/main.go
index fdb5ccf..8a68f58 100644
--- a/main.go
+++ b/main.go
@@ -34,9 +34,57 @@ type mysqlConnKey struct {
username, pass, session string
}
+type request struct {
+ query string
@miguelff
miguelff / postgres-cheatsheet.md
Created July 4, 2022 10:33 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@miguelff
miguelff / dump.sql
Last active June 14, 2021 16:06 — forked from AlexeyKupershtokh/dump.sql
Postgres DDL to Clickhouse converter
select
concat(
'create table ',
table_name,
'(',
string_agg(
concat(
column_name,
' ',
CASE when is_nullable = 'YES' THEN 'Nullable(' END,
@miguelff
miguelff / main.go
Created February 5, 2021 12:43 — forked from wolfeidau/main.go
Golang Backpressure Example
package main
// The aim of this example is to illustrate backpressure using golang channels and go routines.
//
// This is the basis for a simple data processing service which could either be reading from
// some internal queue or a socket of some sort.
import (
"fmt"
"math/rand"
@miguelff
miguelff / octave.md
Created March 30, 2020 15:41 — forked from obstschale/octave.md
An Octave introduction cheat sheet.

Octave CheatSheet

GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)

Basics

  • not equal ~=
  • logical AND &&
WITH fulfillment_method_classification AS (
SELECT
f._shop_key,
f."order id",
f."shop shipping country",
f."fulfillment id",
CASE
WHEN ofsd."is shopify shipping fulfillment" = 'Fulfilled via Shopify Shipping'
THEN 'Shopify Shipping'
WHEN _api_client_key = -2

Keybase proof

I hereby claim:

  • I am miguelff on github.
  • I am miguelff (https://keybase.io/miguelff) on keybase.
  • I have a public key ASBI6T5HfJcq531pX597-0OiXujhozFobuX58IqS8qHR8go

To claim this, I am signing this object: