Skip to content

Instantly share code, notes, and snippets.

View ejwessel's full-sized avatar
🖲️
Prismatic Core Online

Ethan Wessel ejwessel

🖲️
Prismatic Core Online
View GitHub Profile
@jeremyyeo
jeremyyeo / README.md
Last active August 14, 2024 12:21
Dynamically generating `where` parameters to the `dbt_utils.union_relations` macro #dbt

Dynamically generating where parameters to the dbt_utils.union_relations macro

-!  🚨                                          WARNING                                          🚨  !-
There is basically no reason for you to do this - written just to show that it's possible.

Let's assume for a second, we have a few incremental models that we want to union with dbt_utils.union_relations().

// SPDX-License-Identifier: CC0
pragma solidity ^0.8.0;
// author @koeppelmann
// Detector Factory allows to deploy new CensorshipDetector
// Each CensorshipDetector monitors wether a specific address is being cencored on Ethereum
// Each CensorshipDetector must be funded with ETH (anyone can send ETH to the CensorshipDetector)
// Once funded anyone can call the "withdrawal" in the "CensorshipDetector" every 1h and it will pay a small bounty to tx.origin (100k * basefee)
// During this transaction the "CensorshipDetector" will send 1 wei to the address that is endangered of being cencored.
// CensorshipDetector will log the coinbase (validator address) (those are NOT censoring) and the number of blocks that has passed.
@jclancy93
jclancy93 / broker-exploit.js
Created February 13, 2021 17:26
Exploit for Paradigm's CTF Broker Challenge
const setupAddress = 'YOUR_SETUP_ADDRESS';
const wethAddress = 'YOUR_WETH_ADDRESS';
const web3 = new Web3(web3Provider);
(async () => {
console.log('Running exploit.....');
try {
// Script Setup
console.log('Starting script setup....')
@vasanthk
vasanthk / System Design.md
Last active April 22, 2025 06:40
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?
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active February 10, 2025 22:15
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@lestoni
lestoni / gist:8c74da455cce3d36eb68
Last active April 8, 2025 13:37
vim folding cheatsheet

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@mariozig
mariozig / migrate_repo.sh
Last active September 16, 2024 18:48
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror [email protected]:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork [email protected]