Skip to content

Instantly share code, notes, and snippets.

View m1guelpf's full-sized avatar

Miguel Piedrafita m1guelpf

View GitHub Profile
@leptos-null
leptos-null / YouTube_Music_Client.md
Last active April 12, 2024 03:31
Writing an iOS YouTube Music client

Writing an iOS YouTube Music client

I’ve been using YouTube Music as my main music streaming service for almost a year and a half. The iOS client is great- I’ve never had a single complaint. It’s potentially one of the most bug free apps I’ve ever used, it has an extremely friendly, and simple, graphical interface, and the service itself is great.

I was curious how the client worked in terms of networking, and while curiosity may treat cats poorly, it lands researchers in black sites can provide a lot of insight.

Step 0

The first thing I do when reverse engineering a client is monitor HTTP requests while the application starts up, and when doing the tasks interested in. On a jailbroken iOS device, I use FLEX by FlipBoard.

@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active April 22, 2025 22:44
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

# Go here for the working version: https://gist.github.com/tombulled/d313c54a0681fcf0ba6d8092f11411e6#gistcomment-3069388
import hashlib
from pprint import pprint
import base64
import bytebuffer # https://github.com/alon-sage/python-bytebuffer, pip install bytebuffer
# Other ByteBuffer classes I've found: https://github.com/iGio90/PyByteBuffer, https://github.com/aglyzov/bytebuffer
import secrets
import pyaes # https://github.com/ricmoo/pyaes, pip install pyaes

Twitter abuses all media file uploads, each type in its own way. If we want to upload a good looking animation loop from some low-color, high-detail generative art, we have to game their system's mechanisms.

  • don't upload a video file, they will re-encode it into absolute 💩

  • create a GIF, which they will auto-convert into a video file 😱

  • The frames of the GIF will be resized to an even-sized width using an extremely naive algorithm. Your GIF should be an even size (1000, 2000,

@jonbarrow
jonbarrow / connect.js
Last active October 22, 2023 21:20
Discord remote login script example
/*
Discord is able to log users in by scanning QR codes on the login screen,
these are randomly generated by the server and are sent to the client
over a secure web socket as a fingerprint, which gets scanned in by the app
and then used to login remotely. The QR codes actual contents are just
https://discord.com/ra/FINGERPRINT
This script shows how to connect to Discord and generate these
fingerprints automatically
*/
@hrkrshnn
hrkrshnn / generic.org
Last active March 19, 2025 23:52
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@z0r0z
z0r0z / MultiSig.sol
Created December 26, 2021 03:28
EIP-712-signed multi-signature contract
// SPDX-License-Identifier: GPL-3.0-or-later
error NoExecParity();
error NoSigParity();
error NotSigner();
error SigOutOfOrder();
@z0r0z
z0r0z / GeneralizedGrimoire.md
Created January 5, 2022 02:15
MCV Grimoire for Investment Clubs, in github markdown with generalized references to allow for more options in chain and code references.

OPERATING AGREEMENT OF [[DAO LLC NAME]]

This Operating Agreement (this “Agreement”) sets forth the rights and obligations among [[DAO LLC NAME]], a Delaware limited liability company (the “Org”) and the members of the Org.

BACKGROUND

A. The Org has been formed for the purposes contemplated by this Agreement by the filing with the Secretary of State of the State of Delaware of a Certificate of Formation (the “Certificate”) in accordance with the Delaware Limited Liability Company Act (the “Delaware LLC Act”).

B. This Agreement is being entered into for the purposes of organizing and establishing the governance and operations of the Org and the rights and obligations of membership in the Org.

@z0r0z
z0r0z / SingleNFT.sol
Last active June 2, 2022 08:20
1-of-1 NFT built on Solmate
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol";
/// @notice 1-of-1 NFT.
contract SingleNFT is ERC721 {
string internal URI;
constructor(
@z0r0z
z0r0z / ClubSig.sol
Last active September 24, 2022 19:47
EIP-712-signed multi-signature contract with NFT identifiers for signers and ragequit
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/src/tokens/ERC721.sol";
import "https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/NFThelper.sol";
/// @notice Minimal ERC-20 interface.
interface IERC20minimal {
function balanceOf(address account) external view returns (uint256);