Skip to content

Instantly share code, notes, and snippets.

View davidhq's full-sized avatar
🎯
Focusing

davidhq

🎯
Focusing
View GitHub Profile
@davidhq
davidhq / youtube_blacklist.js
Last active February 17, 2024 22:00
YouTube Blacklist
const DISABLE_CHANNELS = ['JMMates', 'Kotte Animation', 'Oddly Viral', 'Mr. Chaliche', 'Like Nastya', 'Like Nastya Show', 'Pear Vlogs', 'Smile Family', 'HowToBasic', 'MrBeast', 'Decija Zona', 'Ha Hack', 'Vlad un Niki', 'Little Panda', 'ReactingToGaming', 'Teen-Z', 'Troom Troom PT', 'Master Thunder', 'LankyBox', 'AnythingAlexia', 'Omco'];
const FORBIDDEN_WORDS = [
'!!!',
'\?\?\?',
'$',
'€',
'ë',
'ö',
'r\.i\.p',
@davidhq
davidhq / kids_censor_youtube.md
Last active January 14, 2023 18:16
For kids — How to remove YouTube shorts, all live videos, videos based on keywords and censor specific channels 😈 🤘

Improve YouTube

Scripts that is injected into YouTube website on the frontend via Chrome extension and does the following ↴

  1. Remove YouTube Shorts
  2. Remove all Live videos
  3. Disable any channel which matches a given list
  4. Remove all videos where title or channel name includes any of listed forbidden words
  5. Carpet-ban all videos which include specific 'foreign' characters (because filtering on english words is not possible)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
contract StringConcater {
// only in 0.8.12 and above
function concatStringsNewWay() public pure returns(string memory) {
string memory hiMom = "Hi Mom, ";
string memory missYou = "miss you.";
return string.concat(hiMom, missYou);
# Setup private variables (only callable from within the contract)
struct Funder :
sender: address
value: uint256
funders: HashMap[int128, Funder]
nextFunderIndex: int128
beneficiary: address
deadline: public(uint256)
from vyper.interfaces import ERC20
totalEthQty: public(uint256)
totalTokenQty: public(uint256)
# Constant set in `initiate` that's used to calculate
# the amount of ether/tokens that are exchanged
invariant: public(uint256)
token_address: ERC20
owner: public(address)
@davidhq
davidhq / mpv_install.md
Last active July 4, 2024 07:37
mpv ◈ Media Player binary -- Install macOS / linux / windows
@davidhq
davidhq / seedprotect.js
Last active September 26, 2020 00:02
seedprotect.js
const crypto = require('crypto');
function lpad(str, padString, length) {
while (str.length < length) str = padString + str;
return str;
}
// converts string '1100' to integer 12
function binaryToByte(bin) {
return parseInt(bin, 2);
# PREREQUISITES:
#
# The default GPU memory setting on the Raspberry is 64 MB. Mpv requires 128 MB or it will not work – so let's change that setting:
# sudo raspi-config
# advanced options / memory split
# source: https://www.raspberrypi.org/forums/viewtopic.php?t=199775
@davidhq
davidhq / code.js
Last active December 26, 2019 07:20
index.js
if ('a'.replace(/\//g, '')) {
// something
}
const v8 = require('v8');
const dmt = require('dmt-bridge');
const { stopwatch, util } = dmt;
//const clone = require('./fast-clone');
const justClone = equire('./utilities/just/collection-clone'),
const state = require(dmt.dmtPath + '/state/program.json');
function cloneJSONStringify(obj) {