Skip to content

Instantly share code, notes, and snippets.

View eggfly's full-sized avatar
🎯
flutter-hacking

eggfly

🎯
flutter-hacking
  • Beijing
View GitHub Profile
@eggfly
eggfly / mini_mp3_radio_decoder.c
Created July 9, 2023 06:55 — forked from Flix01/mini_mp3_radio_decoder.c
Very basic single-file, plain C, openAL mp3 radio decoder
// gist made after this issue: https://github.com/mackron/dr_libs/issues/142
/*
The license refers to this single file.
Every included or linked library comes with its own license
===============================================================================
Public Domain (www.unlicense.org)
===============================================================================
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
@eggfly
eggfly / main.cpp
Created October 16, 2022 14:44 — forked from fffonion/main.cpp
Read Xiaomi Mijia temperature and humidity sensor 2 (LYWSD03MMC) from ESP32
#include <Arduino.h>
#include <BLEDevice.h>
BLEClient *pClient;
BLEScan *pBLEScan;
#define SCAN_TIME 10 // seconds
bool connected = false;
@eggfly
eggfly / pycurses.py
Created August 23, 2022 03:49 — forked from claymcleod/pycurses.py
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@eggfly
eggfly / repo-rinse.sh
Created August 9, 2022 06:06 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@eggfly
eggfly / main.dart
Created July 29, 2022 09:25 — forked from nosmirck/main.dart
Async where and examples for List<T>
void main(List<String> arguments) async {
var list = List.generate(10, (i) => i)..addAll(List.generate(10, (i) => i));
//Normal Where
print(list.where(foo).toList());
//Async Where
print((await list.whereAsync(fooAsync)).toList());
//Normal UniqueWhere
print(list.uniqueWhere(foo).toList());
//Async UniqueWhere
print((await list.uniqueWhereAsync(fooAsync)).toList());
@eggfly
eggfly / readme.en.md
Created June 15, 2022 06:44 — forked from CombinedEffort/readme.en.md
How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

  1. Follow the excellent gist here, up to and including step 7 : https://gist.github.com/niw/e4313b9c14e968764a52375da41b4278

  2. I converted my VHDX to qcow2 - I doubt if that's significant, but YMMV:

./qemu-img convert -p -O qcow2 ~/Windows11_InsiderPreview_Client_ARM64_en-us__22454-orig.VHDX Windows11.img
  1. Run qemu with a slightly modified command-line. It may not be the most efficient, but it worked for me:
@eggfly
eggfly / FlutterEmbedderGLFW.cc
Created December 31, 2021 06:47 — forked from chinmaygarde/FlutterEmbedderGLFW.cc
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@eggfly
eggfly / global-gitignore.md
Created December 5, 2021 12:36 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@eggfly
eggfly / read_guid.ino
Created September 28, 2021 03:49 — forked from ksasao/read_guid.ino
Read GUID of LGT8F328P
void setup() {
Serial.begin(9600);
delay(1000);
// read GUID of LGT8F328P
// https://www.avrfreaks.net/sites/default/files/forum_attachments/LGT8F88P%20LGT8F168P%20LGT8F328P%20translated.pdf
// if you want to read other device's unique id, use ArduinoUniqueID
// https://www.arduinolibraries.info/libraries/arduino-unique-id
#ifdef _LGT8F328P_SPEC_H_
char buf[10];
@eggfly
eggfly / LibraryLoaderHelper.java
Created August 11, 2021 08:10 — forked from NLMartian/LibraryLoaderHelper.java
The class provides helper functions to extract native libraries from APK, and load libraries from there.
package org.chromium.base.library_loader;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;