Skip to content

Instantly share code, notes, and snippets.

View alexcmgit's full-sized avatar

Alex Castro alexcmgit

View GitHub Profile
@alexcmgit
alexcmgit / do-not-touch-my-adblocker-bro.js
Created September 24, 2022 09:56
Tampermonkey Script to bypass anti-adblocker of https://xdarom.com
// ==UserScript==
// @name Bypass xdarom.com anti-adblocker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://xdarom.com*
// @icon https://www.google.com/s2/favicons?sz=64&domain=xdarom.com
// @grant none
// ==/UserScript==
@echo off
::
:: Checks if Microsoft Edge is installed, and uninstall it and EdgeWebView
:: Only Works with the newer Edge, built on Chromium
::
:: Creator: ShadowWhisperer
:: Github: https://github.com/ShadowWhisperer
:: Created: 12/09/2020
:: Updated: 07/08/2022
# Requires https://imagemagick.org/script/download.php
# If using windows include the installation folder in the environment PATH
# Invert image colors
convert -negate image-input.jpg image-output.jpg
# Apply grayscale filter
convert image-input.jpg -type Grayscale image-output.jpg
@alexcmgit
alexcmgit / Invert-Image.ps1
Created August 13, 2022 13:42 — forked from kneeprayer/Invert-Image.ps1
Invert Color Of An Image Using Powershell
#
# Usage : .\Invert-Image.ps1 .\test*.png
#
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
Get-ChildItem $args[0] | ForEach-Object {
$image = New-Object System.Drawing.Bitmap($_.fullname)
for ($y = 0; $y -lt $image.Height; $y++) {
for ($x = 0; $x -lt $image.Width; $x++) {
$pixelColor = $image.GetPixel($x, $y)
$varR = 255 - $pixelColor.R
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@alexcmgit
alexcmgit / fuck-youtube-shorts.js
Last active September 23, 2022 16:27
Tampermonkey Script that removes all YT shorts from feeds
// ==UserScript==
// @name Go Fuck Off YouTube Shorts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://www.youtube.com*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
function colorName(c) {
if (c.startsWith("#")) {
return `Color(0xff${c.substr(1, c.length)})`;
} else {
const color = c.split(/(\(|\))/g)[2];
return `Color.fromRGBO(${color})`;
}
}
function varName(c) {
import 'dart:typed_data';
void main() async {
// Generate a stream that emits an [Uint8List] every second containing a single element which is the second index [c]
final stream = Stream.periodic(Duration(seconds: 1), (c) => Uint8List.fromList([c + 1])).asBroadcastStream();
// Take only 3 seconds
final rawData = stream.take(3).toList();
final processedData = stream.take(3).reduce((previous, current) => Uint8List.fromList([...previous, ...current]));
/// Checks if [source] contains all the characters of [text]
/// in the correct order
///
/// Example:
/// ```
/// hasMatch('abcdef', 'adf') // true
/// hasMatch('dbcaef', 'adf') // false
/// ```
bool hasWildcardMatch(String source, String text) {
final regexp = text.split('').join('.*');
def get_class_that_defined_method(meth):
import functools, inspect
if isinstance(meth, functools.partial):
return get_class_that_defined_method(meth.func)
if inspect.ismethod(meth) or (inspect.isbuiltin(meth) and getattr(meth, '__self__', None) is not None and getattr(meth.__self__, '__class__', None)):
for cls in inspect.getmro(meth.__self__.__class__):
if meth.__name__ in cls.__dict__:
return cls
meth = getattr(meth, '__func__', meth) # fallback to __qualname__ parsing
if inspect.isfunction(meth):