Skip to content

Instantly share code, notes, and snippets.

View thosakwe's full-sized avatar
🎯
Focusing

Tobe Osakwe thosakwe

🎯
Focusing
View GitHub Profile
@thosakwe
thosakwe / force_enable_pip.js
Last active November 1, 2024 18:31
Tampermonkey: Force enable picture-in-picture on Crunchyroll, as of Nov 2024
// ==UserScript==
// @name Force enable PiP on Crunchyroll
// @namespace http://tampermonkey.net/
// @version 2024-11-01
// @description Adds a "Force PiP" button to the top of the Crunchyroll Vilos player
// @author tobebuilds.com
// @match https://static.crunchyroll.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=crunchyroll.com
// @grant none
// ==/UserScript==
@thosakwe
thosakwe / monad.dart
Created June 28, 2021 21:03
Dart monad [WIP]
abstract class Monad<T> {
abstract MonadInstance<U> bind<U>(FutureOr<Monad<U>> Function(T) f);
abstract MonadInstance<T> wrap(T value);
}
abstract class EitherMonad<L, R> extends Monad<Either<L, R>> {
static EitherMonad<L, Exception> wrapTryCatch<L>(FutureOr<L> Function() f);
abstract EitherMonad<U, R> bindLeft(FutureOr<U> Function(L) f);
abstract EitherMonad<L, U> bindRight(FutureOr<U> Function(R) f);
import <http>
func WrapNum(value) -> { value }
timesTwo = .value * 2
print(timesTwo(WrapNum(2)).value)
srv = HttpServer(ctx {
{req, res} = ctx
@thosakwe
thosakwe / README.md
Last active February 28, 2020 00:10
Angel mailer...

angel_mail

A service for Angel that uses package:mailer to send e-mails. It also supports rendering templates (Jael, mustache, whatever), which makes developing email templates easier. In addition, if given an assetsDir, it will inline CSS stylesheets (use cacheAssets: true in production).

@thosakwe
thosakwe / query.txt
Created November 12, 2019 15:17
Functional database query language
# create table users
schema users =
{
id: serial;
name: string;
age: int;
}
# select * from users
users
@thosakwe
thosakwe / hey.lisp
Last active October 27, 2022 13:02
Flutter in Lisp???
(defclass MyWidget (StatelessWidget)
(defun build (ctx)
(Column
(AppBar
:title (Text "Hello, Disp!")
:actions (list
(Text "A")
(Padding
:padding (EdgeInsets.all 16)
:child (Text "B"))))
@thosakwe
thosakwe / hey.js
Created August 10, 2019 02:51
alert
alert()
@thosakwe
thosakwe / copy_dir.dart
Created July 17, 2019 15:54 — forked from tobischw/copy_dir.dart
Recursively copy directory in Dart (requires "path")
/*
* I'm sure there's a better way to do this, but this solution works for me.
* Recursively copies a directory + subdirectories into a target directory.
* There's also no error handling. Have fun.
*/
import 'dart:io';
import 'package:path/path.dart' as path;
Future<void> copyDirectory(Directory source, Directory destination) async {
@thosakwe
thosakwe / about-me.md
Last active July 19, 2020 10:00
About Me