Skip to content

Instantly share code, notes, and snippets.

View nmrshll's full-sized avatar
🦀
rusting

Nicolas Marshall nmrshll

🦀
rusting
View GitHub Profile

Ethereum has a conflict between native token ETH and third-party tokens.

The first example of it is Maker. In case of Maker, the user locks ETH and gets PETH (Pooled ETH) token, which then gets locked into CDPs and that issues DAI (see whiteboard for more detail). At the same time DAI borrow rate accrues to MKR token holders (via burning MKR).

There is clearly in this model a way to remove MKR and just buy more ETH for the Pool, accruing value to all of Pool holders instead (also would incentivize holding CDPs longer as it now becomes a yield generating asset) Or even better, by buying and burning ETH - value would accrue to ALL ETH holders.

Similar story goes when a third-party token is used for transaction fees or as intermediate. There are no direct captures in such a token, and it can be removed by forking the contract. The most known example is Uniswap being a Bancor without their BNT token. Bancor is splitting value between liquidity providers and BNT vs in Uniswap the value only goes to liquidity

@nmrshll
nmrshll / convert_all_flac_to_mp3.sh
Last active January 29, 2020 23:45
Convert all flac files in a folder/subfolders to mp3
for f in ./**/*.flac; do
# echo $f;
DIR=$(dirname "$f");
NAME=$(basename "$f" | cut -d'.' -f1);
sox "${f}" -C 320 -S "${DIR}/${NAME}.mp3"
done
# or
# handles filenames with spaces
/**
* Converts an ArrayBuffer to a String.
*
* @param buffer - Buffer to convert.
* @returns String.
*/
export default function arrayBufferToString(buffer: ArrayBuffer): string {
return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer)));
}
@ilblackdragon
ilblackdragon / serialize.rs
Last active October 19, 2023 03:07
Protobuf vs Bincode vs CBOR
/*
test serialize_bincode_block ... bench: 2,187,247 ns/iter (+/- 305,944)
test serialize_bincode_block2 ... bench: 2,214,480 ns/iter (+/- 359,709)
test serialize_bincode_tx ... bench: 2,280 ns/iter (+/- 222)
test serialize_cbor_block ... bench: 1,950,128 ns/iter (+/- 188,149)
test serialize_cbor_tx ... bench: 2,182 ns/iter (+/- 334)
test serialize_proto_block ... bench: 3,688,611 ns/iter (+/- 541,517)
test serialize_proto_tx ... bench: 3,567 ns/iter (+/- 449)
@Matthias247
Matthias247 / async_await_cancellation.md
Created May 28, 2019 06:09
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@agrcrobles
agrcrobles / android_instructions_29.md
Last active June 2, 2024 05:54 — forked from patrickhammond/android_instructions.md
Setup Android SDK on OSX with and without the android studio

Hi, I am a fork from https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03.

A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.

Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.

Prerequisites:

https://github.com/shyiko/jabba instead ?

@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru