Skip to content

Instantly share code, notes, and snippets.

View FlafyDev's full-sized avatar
☄️
Programming

Flafy FlafyDev

☄️
Programming
  • Israel
  • 11:25 (UTC +02:00)
View GitHub Profile
@FlafyDev
FlafyDev / cote-characters.json
Last active August 9, 2022 13:44
List of Classroom of the Elite characters for my book reader.
[
{
"name":"Airi Sakura",
"image":"https://static.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/b/b8/Airi_Sakura_LN_visual.png",
"descriptionMarkdown":""
},
{
"name":"Akane Tachibana",
"image":"https://static.wikia.nocookie.net/youkoso-jitsuryoku-shijou-shugi-no-kyoushitsu-e/images/8/88/Akane_Tachibana_Anime_Appearance.png",
"descriptionMarkdown":""
@FlafyDev
FlafyDev / book_downloader.dart
Created August 9, 2022 09:27
ZLibrary metadata and downloader for my book reader.
import 'package:epub_reader/providers/book_downloader/zlibrary_book_downloader.dart';
import 'package:http/http.dart';
import '../../models/book.dart';
abstract class BookDownloader {
Client httpClient;
BookDownloader({required this.httpClient});
Future<Uri?> getEpubDownload(BookIdentifier bookIdentifier);
@FlafyDev
FlafyDev / wake.sh
Last active August 2, 2022 18:07
shell script to make a usb device be able to wake up from suspend.
input=$1
dmesg | grep "\[.*\] usb [^:]*: .*$input" | grep -o -P "usb .*?:" | grep -o "[0-9][^:]*" | uniq | while read device; do echo enabled >/sys/bus/usb/devices/$device/power/wakeup; done
building the system configuration...
error: infinite recursion encountered
at /nix/store/a885zpv9ys2p2x7qnzqvxlsy321mclip-source/lib/modules.nix:283:21:
282| (regularModules ++ [ internalModule ])
283| ({ inherit lib options config specialArgs; } // specialArgs);
| ^
284| in mergeModules prefix (reverseList collected);
@FlafyDev
FlafyDev / solution.ts
Created June 22, 2022 15:35
Solution to my Codingame challenge in TypeScript
interface Change {
line: number,
column: number,
str: string,
}
class InsertManager {
changes: Change[] = []
constructor(public str: string) { }
@FlafyDev
FlafyDev / solution.dart
Created June 22, 2022 14:33
Solution to my Codingame challenge in Dart
import 'dart:io';
String readLineSync() {
String? s = stdin.readLineSync();
return s == null ? '' : s;
}
class Change with Comparable<Change> {
int line;
int column;
@FlafyDev
FlafyDev / close_other_instances.py
Created June 5, 2021 15:38
Closes other instances of the same python script when called.
import psutil
import os, inspect
def close_others(file=None):
if file is None:
this_path = os.path.abspath(inspect.stack()[-1].filename)
else:
this_path = os.path.realpath(file)
processes = []