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 / main.dart
Created July 29, 2022 07:13
flutter refresh data source
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
@CombinedEffort
CombinedEffort / readme.en.md
Last active January 28, 2024 20:58
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 / blaster.c
Created August 1, 2018 03:46 — forked from yorickdewid/blaster.c
Blaster worm source
/*
DECOMPILED SOURCE FOR MS RPC DCOM BLASTER WORM
<http://robertgraham.com/journal/030815-blaster.c>
This file contains source code for the "msblast.exe" worm
that was launched against the Internet on August 10, 2003.
This "source-code" was decompiled using "IDApro", an
"interactive disassembler". IDA is the most popular tool
@claymcleod
claymcleod / pycurses.py
Last active July 20, 2024 00:12
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()
@RameshRM
RameshRM / BackgroundFetch.swift
Last active March 8, 2022 14:36
Swift Background Fetch
Step 1: Enable capabilities "background fetch"
Step2 : Setup AppDelegate.swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)
return true;
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
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
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"