Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@0age
0age / c000r.sol
Last active January 20, 2023 04:31
0xMonaco car (top-ranked finisher by ELO, Paradigm CTF 2022) https://0xmonaco.ctf.paradigm.xyz/viewTeam/OpenSea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16; // (10M optimization runs)
interface MonacoInterface {
struct CarData {
uint32 balance; // Where 0 means the car has no money.
uint32 speed; // Where 0 means the car isn't moving.
uint32 y; // Where 0 means the car hasn't moved.
Car car;
}
@karmacoma-eth
karmacoma-eth / sending-ether-cheat-sheet.md
Last active March 12, 2024 01:14
Sending Ether Cheat Sheet

Sending Ether Cheat Sheet

TLDR

🥇 Instead of sending Ether, use the withdrawal pattern

🥈 If you really need to send Ether, use a safe wrapper like OpenZeppelin's Address.sendValue(addr, amount)

🥉 If you really need to send Ether without dependencies, use (bool success, ) = addr.call{value: amount}("")

@backus
backus / signTypedData.js.md
Created April 8, 2018 20:48
How signTypedData works

I couldn't find a good explanation of each step of signTypedData EIP with examples of inputs and outputs at each step. I wanted this so I could keep track.

Say this is our private key

const privKey = new Buffer(
  "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
  "hex"
);
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@AlwaysBCoding
AlwaysBCoding / script.js
Created March 3, 2017 03:28
Ethereum Ðapp Development - Video 18 | Signing Arbitrary Messages
// Private Key
var pKey = "..."
var pKeyx = new Buffer(pKey, "hex")
// Shared Message
var message = "..."
var messageHash = web3.sha3(message)
var messageHashx = new Buffer(messageHash.replace("0x", ""), "hex")
// Signed Hash
@subfuzion
subfuzion / curl.md
Last active April 23, 2024 14:44
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@dominictarr
dominictarr / TahoeLAFS.md
Last active April 26, 2023 04:28
Writing out part of the Tahoe LAFS paper in my own words to check my understanding.

Tahoe LAFS

Tahoe LAFS is a distributed file system with an interesting permissions model. (whitepaper) Both Immutable and Mutable files are supported (Mutable is the most complex and interesting) There are three levels of permissions, Write, Read, and Verify. Each permission is granted by giving a user a special key called a "capability". If you have the Write capability you can update the file, if you have the Read capability you can retrieve the plain text, but if you only have the Verify capability you can only validate the file integrity, but not read the contents.

The lower level capabilities are generated deterministically from the higher level capabilites.

@adharris
adharris / postgres_array.go
Created November 28, 2012 19:52
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"