Skip to content

Instantly share code, notes, and snippets.

View ju-c's full-sized avatar

Julien Cortesi ju-c

View GitHub Profile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@vasanthk
vasanthk / System Design.md
Last active November 30, 2024 06:26
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mejiaro
mejiaro / fix-postgresql-linux.md
Last active November 3, 2023 06:49
Fixing Postgresql's "could not connect to server" on Linux Mint (or Ubuntu)

Got the dreaded, only-macOs documented "No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432" but you are using wither Mint or Ubuntu?

Here's how to fix it.

  1. verify the contents of /etc/postgresql/9.5/main/pg_hba.conf

  2. if the file is empty, add this conf

@Dexaran
Dexaran / ERC20_token_standard_vulnerability_classification.md
Last active June 22, 2024 22:51
ERC20 token standard vulnerability classification.

Previously described at: ERC20 critical problems medium article.

Description.

ERC20 is the most common Ethereum token standard. It should be noted that it is also the first Ethereum's token standard as well.

It is also important that the original ERC20 proposal is a definition of token interface. EIP20 does not define a reference implementation for this token standard. Here is OpenZeppelin implementation of ERC20 token: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token/ERC20

ERC20 token standard implementation assumes two ways of token transferring: (1) transfer function and (2) approve + transferFrom pattern.

@bitPico
bitPico / gist:904352bd356baff866093de57c8caa23
Created June 27, 2018 03:43
Bitcoin ABC Large Block ZeroDay Vulnerability - 01
static bool ConnectBlock(const Config &config, const CBlock &block,
CValidationState &state, CBlockIndex *pindex,
CCoinsViewCache &view, bool fJustCheck = false) {
==> AssertLockHeld(cs_main);
// ...
==> if (!control.Wait()) {
return state.DoS(100, false, REJECT_INVALID, "blk-bad-inputs", false,
@simonw
simonw / README.md
Created November 5, 2022 21:03
Stream activity from Mastodon into a SQLite database

Stream Mastodon activity into a SQLite database

This script subscribes to the live HTTP feed of public activity on my Mastodon instance and writes the results into SQLite database tables.

It needs sqlite-utils and httpx:

pip install sqlite-utils httpx

Then run: