This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - run with `mitmdump -s intercept.py -q` | |
# - clear counters with | |
# curl -sx localhost:8080 http://example.com/clear | jq | |
# - show counters with | |
# curl -sx localhost:8080 http://example.com/show | jq | |
import json | |
import typing | |
import mitmproxy.http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
# https://gist.github.com/cincodenada/6557582 | |
def rotr(num, bits): | |
num &= (2 ** bits - 1) | |
bit = num & 1 | |
num >>= 1 | |
if (bit): | |
num |= (1 << (bits - 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import typing | |
from dataclasses import dataclass, field | |
from queue import Queue | |
from typing import TypeVar, Generic | |
T = TypeVar('T') | |
R = TypeVar('R') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# HAHA, so you may not blame me. | |
exit 1 | |
set -euo pipefail | |
# eg sda1 | |
DISK="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ExtractHookProps<T> { | |
extractor: () => T; | |
setup: (hookValue: T) => void; | |
} | |
function ExtractHook<T>(props: React.PropsWithChildren<ExtractHookProps<T>>) { | |
let {extractor, setup, ...others} = props; | |
let hookValue = extractor(); | |
setup(hookValue); | |
return <div {...others} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove analytics boxes on every tweet | |
twitter.com##div:has(> a[href$="/analytics"]):style(display: none !important) | |
# remove footer | |
twitter.com##div:has(> nav[aria-label="Footer"][role="navigation"]) | |
# remove relevant people sidebar | |
twitter.com##div:has(> aside[aria-label="Relevant people"][role="complementary"]) | |
# one-line for-you|following header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/envoyproxy/data-plane-api/blob/main/envoy/service/ratelimit/v3/rls.proto | |
syntax = "proto3"; | |
package envoy.service.ratelimit.v3; | |
service RateLimitService { | |
rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date | title | yt_id | url | active | registrant | debug | |
---|---|---|---|---|---|---|---|
20110706 | Johnny English Reborn Exclusive Trailer | wawSjr2xX74 | www.johnnyenglishreborn.com.au | False | |||
20111123 | Battleship - Global Teaser Trailer | 3EtQDQgj3iQ | battleshipmovie.com | True | |||
20111125 | American Pie Reunion | f_Sb-xsIKPs | americanreunionmovie.com.au | False | |||
20120116 | American Pie Reunion - Red Band Trailer | spv2lOBRDWw | americanreunionmovie.com.au | False | |||
20120124 | American Pie: Reunion - Trailer B | QsllnLSOEjM | americanreunionmovie.com.au | False | |||
20120215 | Dr Seuss The LORAX - Zac Efron How to Get a Girl | 39vZOPsdT1k | www.theloraxmovie.com.au | False | |||
20120213 | Dr Seuss The LORAX - Zac Efron on Ted | kp11JnYDI1E | www.theloraxmovie.com.au | False | |||
20120217 | Dr Seuss The LORAX - Taylor Swift on Audrey | wEP-GmqB0xk | www.theloraxmovie.com.au | False | |||
20120214 | Dr Seuss The LORAX - Betty White on Grammy Norma | LVpV4jCu7yE | www.theloraxmovie.com.au | False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.dummy.jmhbench | |
object FeatureFlags { | |
val enabled: String = System.getenv("FEATURE-FLAG-ENABLED") ?: "false" | |
val enabledT: Boolean = enabled.toBoolean() | |
fun viaFunction(): String { | |
return System.getenv("FEATURE-FLAG-ENABLED") ?: "false" | |
} |