Skip to content

Instantly share code, notes, and snippets.

View mendes5's full-sized avatar
📉
[object Object]

mendes5

📉
[object Object]
View GitHub Profile
Text to Speech For Pepegas
*Only tested with Brian voice*
Testing your message
You can use the following website which emulates TTS:
https://5e7en.me/tts
Cheering vs Donations
@nickpeirson
nickpeirson / zombie_slayer.sh
Last active May 15, 2023 06:30
Script to clean Zombie processes up using gdb
#!/bin/bash
##################################################################
# Script: Zombie Slayer
# Author: Mitch Milner
# Date: 03/13/2013 ---> A good day to slay zombies
#
# Requirements: yum install gdb / apt-get install gdb
# permissions to attach to the parent process
#
# This script works by using a debugger to
#! /bin/sh
# By Sharky - https://sharky.pw/
COLS=`tput cols`
ROWS=`tput lines`
OWOS=(
"OwO" "ØwØ" "◕w◕" "◔w◔" "ʘwʘ" "𝕆𝕨𝕆" "σωσ" "𝙊𝙬𝙊" "(。O ω O。)"
"UwU" "🆄🆆🆄" "ⓤⓦⓤ" "𝖴𝗐𝖴" "𝓤𝔀𝓤" "( ᴜ ω ᴜ )"
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
@Jessidhia
Jessidhia / react-scheduler.md
Last active March 1, 2024 13:51
Implementation notes on react's scheduling model as of (shortly before) 16.8.0

Implementation notes on react's scheduling model as of (shortly before) 16.8.0

While the public API intended for users to use is the scheduler package, the reconciler currently does not use scheduler's priority classes internally.

ReactFiberScheduler has its own internal "mini-scheduler" that uses the scheduler package indirectly for its deadline-capable scheduleCallback.

This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.

@ErikFontanel
ErikFontanel / filter-youtube-domains.sh
Last active November 28, 2023 18:55
Pi-hole Youtube ad blocking
#!/bin/sh
# This script will fetch the Googlevideo ad domains and append them to the Pi-hole block list.
# Run this script daily with a cron job (don't forget to chmod +x)
# More info here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/136
# File to store the YT ad domains
FILE=/etc/pihole/youtube.hosts
# Fetch the list of domains, remove the ip's and save them
curl 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com' \
@afuggini
afuggini / defineProperty.js
Last active October 29, 2021 17:29
Object.defineProperty polyfill
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
@stevedonovan
stevedonovan / shared.rs
Created April 14, 2017 13:49
An ergonomic way of saying Rc<RefCell>
use std::rc::Rc;
use std::cell::{RefCell,Ref, RefMut};
use std::ops::Deref;
use std::fmt;
#[derive(Clone)]
struct Shared<T> {
v: Rc<RefCell<T>>
}
@eddieantonio
eddieantonio / example.py
Created March 30, 2017 20:43
Zero-dependency Python 3 and Node IPC using UNIX sockets
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import socket
import json
server_address = '/tmp/example.sock'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(server_address)
Parallelizing the Naughty Dog engine using fibers by Christian Gyrling
http://www.swedishcoding.com/wp-content/uploads/2015/03/parallelizing_the_naughty_dog_engine_using_fibers.pdf
id Tech 5 Challenges
From Texture Virtualization to Massive Parallelization by J.M.P. van Waveren
http://s09.idav.ucdavis.edu/talks/05-JP_id_Tech_5_Challenges.pdf
Doom3 BFG Source Code Review: Multi-threading by Fabien Sanglard