Skip to content

Instantly share code, notes, and snippets.

View amake's full-sized avatar
๐ŸŒต

Aaron Madlon-Kay amake

๐ŸŒต
View GitHub Profile
@avestura
avestura / delete-from-users-where-location-iran.md
Last active October 30, 2025 10:23
DELETE FROM users WHERE location = 'IRAN';

DELETE FROM users WHERE location = 'IRAN';

Hi! I am an Iranian Software Engineer, and in this torn paper note, I want to talk about some funny moments I had online related to the fact that I was spawned in this specific region of the world: Iran.

Microsoft deleted my app, ignored my mails

Back when I was a student, I got access to the Microsoft Imagine, and as a result, I got access to the Microsoft Store as a developer. This inspired me write one of my open-source projects called EyesGuard and publish it on Microsoft Store. However, one day, somebody told me that they can no longer find EyesGuard on the store.

This is a pattern I came up with when I was working on a fairly large one person app (25k LOC, legal/regulation calculator, lots of unit testing). It is very simple and very effective.

The short version is you have a RootStore that listens to all of it's child stores. Each store has an async initState method and a dispose method. Make observer mixins for platform channel related items like App Lifecycle, Geolocation, Geofencing that add more lifecycle methods to these stores and manage their own initState/dispose.

I realize that a gist is going to look like a bit of a cluster for something of this nature but I bet if you pull it all down into a project and start playing around with it you'll really enjoy it. Especially now that provider has context.select.

Here's an example of my folder structure in lib/features as a bit of a bonus

@slightfoot
slightfoot / sized_multi_child.dart
Created June 20, 2018 20:34
CustomSizedMultiChildLayout.. lets a child of CustomMultiChildLayout determine its size.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(TestApp());
enum TestId {
First,
Second,
Third,
}
@voluntas
voluntas / death_march.md
Last active September 26, 2025 07:43
ใƒ‡ใ‚นใƒžใƒผใƒใŒ่ตทใใ‚‹็†็”ฑ - ๏ผ“ใคใฎๆŒ‡ๆจ™

ใƒ‡ใ‚นใƒžใƒผใƒใŒ่ตทใใ‚‹็†็”ฑ - ๏ผ“ใคใฎๆŒ‡ๆจ™

่‘—่€…๏ผš ้’ใ„้ด‰๏ผˆใถใ‚‹ใใ‚๏ผ‰ใ•ใ‚“ย @bluecrow2

ใ“ใ‚Œใฏ็ตๅŸŽๆตฉใ•ใ‚“ใฎ้‹็”จใ•ใ‚Œใฆใ„ใŸ YukiWiki ใซๅฝ“ๆ™‚ Coffee ๆง˜ (้’ใ„้ด‰๏ผˆใถใ‚‹ใใ‚๏ผ‰ใ•ใ‚“๏ผ‰ใŒใ‹ใ‹ใ‚Œใฆใ„ใŸๆ–‡็ซ ใงใ™ใ€‚ ใŸใ  2018 ๅนด 3 ๆœˆ 7 ๆ—ฅใซ YukiWiki ใŒ้‹็”จๅœๆญขใ—ใŸใŸใ‚ๆถˆใˆใฆใ—ใพใ„ใพใ—ใŸใ€‚ใใฎ่จ˜ไบ‹ใฎใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใงใ™ใ€‚

ไปŠใฏ 404 ใงใ™ใŒใ€ใ‚‚ใจใ‚‚ใจใฎ่จ˜ไบ‹ใฎ URL ใฏ http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 ใซใชใ‚Šใพใ™ใ€‚

ๆ˜”ใ€่‡ชๅˆ†ใŒใจใฆใ‚‚ๆ„Ÿ้Š˜ใ‚’ๅ—ใ‘ใŸๆ–‡็ซ ใชใฎใงใ€ใ“ใฎใพใพ่ชญใ‚ใชใใชใ‚‹ใฎใฏใจใฆใ‚‚ใ‚‚ใฃใŸใ„ใชใ„ใจๆ€ใ„ใ€ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใจใ—ใฆๅ…ฌ้–‹ใ—ใฆใ„ใพใ™ใ€‚

#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@pmeulen
pmeulen / repair-timemachine-disk-network.sh
Created September 22, 2017 17:58
Script to repair a Time Machine network volume
#!/bin/bash
set -e
###############################################################################
# This script tries to repair a Time Machine *network* backup (i.e. an APF
# share containing a sparsebundle) that is shared over a network using e.g. an
# Apple TimeCapsule, a NAS, Raspberry PI, ...
# The script must be run on the computer that created the backup
#
@shunirr
shunirr / criminal_jc.md
Last active June 21, 2025 08:07
ๅฅณๅญไธญๅญฆ็”Ÿใƒใ‚ฑใƒƒใƒˆ่ฉๆฌบไบ‹ไปถ

criminal_jc

@rtrouton
rtrouton / gist:2ca6f001b3cecb5037825c7f9d2e422e
Created April 28, 2017 16:13
Xcode iOS simulator download URLs (as of Xcode 8.3.1)
iOS 10.2 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_2-10.2.1.1484185528.dmg
iOS 10.1 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_1-10.1.1.1476902849.dmg
iOS 10.0 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_0-10.0.1.1474488730.dmg
iOS 9.3 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
iOS 9.2 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg
iOS 9.1 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_1-9.1.1.1446593668.dmg
iOS 9.0 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_0-9.0.1.1443554484.dmg
iOS 8.4 Simulator: https://devimages.a

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@lawrencelomax
lawrencelomax / Instructions.md
Last active July 27, 2016 07:52
instruments-without-delay on Xcode 7

instruments-without-delay uses the DYLD_INSERT_LIBRARIES environment variable to shim from the instruments command line all the way down to ScriptAgentShim which is the iOS Simulator service responsible for interfacing UIAutomation JavaScript with the native UIAutomation.framework. It uses a stack of shims, starting at the instruments executable, going through Simulator.app. It is an essential part of ios-driver as it removes a pesky 200ms delay that drastically slows down the process of executing end-to-end tests. This is a fixed cost that would occur on every command.

Other than a few things being moved around and renamed in Xcode 7, there is the new issue of the codesigning of the Simulator app that triggers amfid whenever an unsigned image is loaded. This essentially means that we can't use DYLD_INSERT_LIBRARIES on the Simulator Process with SimShim

It is however, possible to inject these environment variables at the launchdaemon level. There is a plist fo