Skip to content

Instantly share code, notes, and snippets.

View Rudxain's full-sized avatar

Ricardo Fernández Serrata Rudxain

View GitHub Profile
@aravindanve
aravindanve / bypass-disable-devtool.md
Last active April 20, 2025 17:34
Bypass disable-devtool

(Working as of 2025-02-09)

There are websites that use disable-devtool to prevent you from opening or using devtools. They typically prevent you from right clicking or using the keyboard shortcut to open devtools. Even if you successfully do so, they detect it and redirect you elsewhere. You can bypass this by using one of the following ways.

Opening devtools

If the shortcut F12 on Windows or Option + ⌘ + I on Mac do not work. Press the three vertically aligned dots in the top right corner of your Google Chrome or Microsoft Edge window. Under the section "More Tools", you'll see the option to select "Developer Tools" which opens the toolkit in your window.

@joboet
joboet / 0000-pattern-types.md
Last active April 14, 2025 02:15
Pattern types RFC

Summary

This RFC introduces pattern types, which are subtypes of matchable types that are statically restricted to a subset of the variants of the original type.

@vi
vi / interesting_crates.md
Last active February 3, 2025 20:05
List of crates that improves or experiments with Rust, but may be hard to find

Let's list here crates that enhance Rust as a language.

It not "batteries" like in stdx, but Rust-specific crates for workarounds for various missing features and experimental ideals from non-accepted/postponed RFCs, or just hacky tricks.

The list is supposed to contain (mostly) crates that are internal to Rust, not ones for making Rust deal with "external world" like other languages bindings, file formats, protocols and so on.

Primary focus should be on crates that are not easy to find by conventional means (e.g. no algorithm name, format or protocol to search for).

Note that quality of the listed crates may vary from proof-of-concept to stable-and-widely-used.

import random
import typing.List
def thanos_sort(a: List[int]) -> List[int]:
'''Removes half of the list until it's perfectly balanced, like all things should be.'''
def _perfectly_balanced(a: List[int]) -> bool:
like_all_things_should_be = True
@rust-play
rust-play / playground.rs
Created September 27, 2018 01:24
Code shared from the Rust Playground
enum RecursionResult<C, R> {
Continue(C),
Return(R),
}
fn tail_recurse<C, R>(mut init: C, mut f: impl FnMut(C) -> RecursionResult<C, R>) -> R {
loop {
match f(init) {
RecursionResult::Continue(c) => init = c,
RecursionResult::Return(r) => return r,
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 22, 2025 09:40
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@koji-kojiro
koji-kojiro / import_from_gist.py
Created December 24, 2016 15:47
[Python] import from Gist
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def load_gist(gist_id):
"""translate Gist ID to URL"""
from json import load
from urllib import urlopen
gist_api = urlopen("https://api.github.com/gists/" + gist_id)
@izabera
izabera / bfsh
Created November 23, 2016 10:23
brainfuck interpreter in posix sh
#!/bin/sh
LANG=C
compile() {
# some preprocessing and basic optimizations
code=$(printf %s "$1" |
(tr -dc '\133\135<>,.+-'; echo) | # ksh's builtin tr doesn't like []<>,.+-
sed -e :a -e 's/<>//g;s/><//g;s/+-//g;s/-+//g
s/\[-]/z/g;s/zzz*/z/g;s/[+-]z/z/g;ta')
print(''.join([chr(x) for x in [int(x,16) for x in \
[str(hex(2 * 2 * 5 * 7 * 37 * 149 * 5417 * 148781 \
* 51939996061871)[i:(i+2)])\
for i in range(25)][2::2]]]))