Skip to content

Instantly share code, notes, and snippets.

View hoc081098's full-sized avatar
✝️
"The Lord is my shepherd; I shall not want." — Psalm 23:1, KJV

Petrus Nguyễn Thái Học hoc081098

✝️
"The Lord is my shepherd; I shall not want." — Psalm 23:1, KJV
View GitHub Profile
@hoc081098
hoc081098 / mobile-clean.sh
Last active July 9, 2026 09:38
Mobile Build Artifact Cleaner. Recursively clean build artifacts and generated cache files from Flutter, Android, iOS, and macOS mobile app projects without running Gradle, Flutter, CocoaPods, or Xcode clean commands. This script is useful for reclaiming disk space, resetting local generated files, and cleaning nested mobile repositories in mono…
#!/usr/bin/env sh
set -eu
# ------------------------------------------------------------------------------------
# Usage examples:
# sh mobile-clean.sh .
# sh mobile-clean.sh --yes .
# sh mobile-clean.sh --yes --pods .
# sh mobile-clean.sh --yes --pods --derived-data .
@selcukcihan
selcukcihan / AGENTS.md
Created April 15, 2026 09:06
agents.md file for your beloved coding agents

Project Rules

These instructions apply to every task performed in this repository.

Purpose

  • Treat this file as the project-wide source of truth for repository-specific working rules.
  • Read and follow these instructions before making changes in this repo.

Working Style

  • Prefer minimal, targeted changes over broad refactors.

Codex Reviewer

You are a code reviewer agent powered by OpenAI Codex. Your job is to review code changes and provide actionable feedback.

Workflow

  1. Receive a review request (diff, file paths, or a description of changes).
  2. Use the mcp__codex__codex tool to start a Codex review session with the relevant code context.
  3. If follow-up analysis is needed, use mcp__codex__codex-reply with the thread ID from step 2.
  4. Summarize Codex's findings into a clear, structured review for the user.
@file:Suppress("RedundantSuspendModifier")
import arrow.core.Either
import arrow.core.computations.either
import arrow.fx.coroutines.parTraverseEitherN
import kotlinx.coroutines.delay
import java.io.IOException
import kotlin.time.ExperimentalTime
import kotlin.time.TimeSource
extension Result {
public func `catch`(_ handler: () throws -> Success) -> Result<Success, Error> {
flatMapError { _ in
.init { try handler() }
}
}
public func `catch`(_ handler: (Failure) throws -> Success) -> Result<Success, Error> {
flatMapError { error in
.init { try handler(error) }
@schultek
schultek / nested_will_pop_scope.dart
Last active March 26, 2024 15:24
An improved WillPopScope widget to allow for nested navigators. See https://github.com/flutter/flutter/issues/47088
import 'package:flutter/material.dart';
class NestedWillPopScope extends StatefulWidget {
const NestedWillPopScope({
Key? key,
required this.child,
required this.onWillPop,
}) : super(key: key);
final Widget child;
using System.Collections.Generic;
using System.Linq;
namespace System.Collections.Immutable
{
public class ImmutableListWithValueSemantics<T> : IImmutableList<T>, IEquatable<IImmutableList<T>>
{
IImmutableList<T> _list;
public ImmutableListWithValueSemantics(IImmutableList<T> list) => _list = list;
@truizlop
truizlop / Wave.swift
Created September 10, 2020 14:41
Wave animation using SwiftUI
import SwiftUI
let LINE_LENGTH: Double = 500.0
let N = 720
let LINES = 18
let WAVES: Double = 18.0
let WAVE_HEIGHT: Double = 20
let SPACING: Double = 27.0
let CURL_AMOUNT: Double = 12.0
@manuelvicnt
manuelvicnt / AnAndroidApp.kt
Last active January 1, 2023 17:05
Hilt and AssistedInject working together in Hilt v2.28-alpha times - ViewModel version
// IMPORTANT! READ THIS FIRST
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject
// Read more about the issue here: https://github.com/google/dagger/issues/2287
//
//
// AssistedInject and Hilt working together in v2.28-alpha times
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt
// As AssistedInject isn't part of Dagger yet, we cannot use in
// conjuction with @ViewModelInject
@varunon9
varunon9 / AlwaysRunningAndroidService.md
Last active April 8, 2026 07:39
How to create an always running service in Android

Full Source Code: https://github.com/varunon9/DynamicWallpaper/tree/always_running_service

Steps-

  1. Create a Foreground Service (MyService.java)
  2. Create a Manifest registered Broadcast Receiver (MyReceiver.java) which will start your Foreground Service
  3. In onDestroy lifecycle of MyService, send a broadcast intent to MyReceiver
  4. Launch the MyService on app start from MainActivity (see step 8)
  5. With above 4 steps, MyService will always get re-started when killed as long as onDestroy of Service gets called
  6. onDestroy method of Service is not always guaranteed to be called and hence it might not get started again