Skip to content

Instantly share code, notes, and snippets.

View alexrintt's full-sized avatar

Alex alexrintt

View GitHub Profile
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
// ==UserScript==
// @name Remove YouTube Thumbnails on Mobile.
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://m.youtube.com/feed/subscriptions
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
@alexrintt
alexrintt / draw-on-page-tampermonkey-script.js
Last active January 13, 2023 02:32
Script that allows you to draw on any website (for sketching, study, etc.), it is a Tampermonkey script.
// ==UserScript==
// @name Draw on page using a pen or mouse
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Hotkey based on page drawer.
// @author @alexrintt
// @match http*://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @license MIT
@alexrintt
alexrintt / mask-str.js
Created January 3, 2023 04:24
Masking string to integer and unmask to string. wip, has bit limit and is not useful for large messages
const bits = 8
function mask(src) {
return Array.from(src).map(e => e.charCodeAt(0)).map((e, i) => e << (i * bits)).reduce((acc, e) => acc | e, 0)
}
function unmask(src) {
let i = 0
const codes = []
const b = (1 << bits) - 1
@alexrintt
alexrintt / yt-channel-video-buffer-hider.js
Last active January 1, 2023 23:01
Tampermonkey filter to hide YT video buffer and keep only the player and the sound. Useful along with https://unhook.app/ and https://github.com/domdomegg/hideytthumbnails-extension and
// ==UserScript==
// @name YouTube Channel Video Buffer Hider
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
import 'dart:math';
extension ChunkedList<T> on List<T> {
/// Slice this list in chunks of a given [size].
///
/// If [size] is a negative number it will slice the reverse list of [this].
///
/// Set [incomplete] to `true` in order to include an incomplete chunk (if any).
///
/// Usage:

Keybase proof

I hereby claim:

  • I am alexrintt on github.
  • I am alexrintt (https://keybase.io/alexrintt) on keybase.
  • I have a public key ASD0A_KWF-QN0q6z9G2rL1PwZTheb1oB5Z8O7Wcn3ZueEAo

To claim this, I am signing this object:

void main() {
// Simulate the [signinResponse] as a simply [String].
Stream<String> signInStream() => Stream<String>.periodic(Duration(seconds: 1), (computation) => 'Login $computation');
// Simulate the [userResponse] as a simply [int].
Stream<int> getUserDetailsStream() => Stream<int>.periodic(Duration(seconds: 1));
final Stream<Stream<int>> itIsWhatYouAreDoing = signInStream().asyncMap((event) => getUserDetailsStream());
// What you are saying you want to achieve:
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
void main() {
List tagId = ['a', 'b'];
List<Map<String, dynamic>> oldList = [
{'id': 'a', 'value': 1},
{'id': 'a', 'value': 1},
{'id': 'a', 'value': 1},
{'id': 'a', 'value': 1},
{'id': 'b', 'value': 1},
{'id': 'b', 'value': 1}
];