Skip to content

Instantly share code, notes, and snippets.

View fannheyward's full-sized avatar
🎯
Slow to response

Heyward Fann fannheyward

🎯
Slow to response
View GitHub Profile
@frostming
frostming / fly.toml
Last active October 13, 2023 03:33
A Fly.io config file for OpenCat™ for Team that can be deployed directly
# fly.toml file generated for still-snowflake-6351 on 2023-03-30T09:53:40+08:00
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "sin"
processes = []
[build]
image = "bayedev/opencatd"
@import Photos;
[PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) {
NSLog(@"PHAuthorizationStatus: %ld", status);
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init];
fetchOptions.includeHiddenAssets = YES;
fetchOptions.includeAllBurstAssets = YES;
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions];
@mtgto
mtgto / serve.mjs
Last active August 25, 2023 03:10
Hot reload and do incremental builds with `esbuild`
/*
* Change from https://gist.github.com/unki2aut/4ac81c33be2e8f121e80a26eba1735d7
* - Use top level await (Node.js v14.8.0+)
* - To use top level await, you need to write a script as ES Modules
* - Set chokidar options to avoid duplicate building
* - Define NODE_ENV (For React)
* - Add API proxy setting by using proxy-middleware
*/
import chokidar from "chokidar";
import esbuild from "esbuild";
@codehz
codehz / iprule.sh
Last active March 4, 2024 09:39
nftables for redir proxy
ip rule add fwmark 0x233 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
@ethanhuang13
ethanhuang13 / FacebookAuth.swift
Last active March 28, 2024 08:24
FacebookAuth is for iOS app developers who need to support Facebook login but don't want to use the official SDK
//
// FacebookAuth.swift
// GitHub: ethanhuang13
// Twitter: @ethanhuang13
import AuthenticationServices
import SafariServices
/*
Updated:
@waylybaye
waylybaye / Measure.swift
Last active March 12, 2024 14:09
SwiftUI view render performance Indicator
// Created by Baye Wayly on 2020/3/13.
// Copyright © 2020 Baye. All rights reserved.
import SwiftUI
struct Measure<Content: View>: View {
@State var cost: TimeInterval = 0
var content: Content
init(@ViewBuilder builder: () -> Content) {
@zu1k
zu1k / check.bat
Last active December 9, 2021 19:33
KMS脚本
@echo off
::配置BAT对话框样式
title KMS服务器检查脚本
MODE con: COLS=42 lines=8
color 0a
::检测vlmcs.exe
@janlay
janlay / README.md
Last active June 27, 2022 15:27
Delete and unfavorite tweets

Delete and unfavorite tweets

This util deletes your historical tweets from a downloaded archive file, unfavorites tweets from your public profile.

No guarantee, no support, use it at your own risk.

Preparations

  1. Apply to become a Twitter developer first.
    Once your Twitter developer account application is approved, You can create a new app and get its Consumer API keys and generate Access token. These keys are used to configure tweet.sh.
  2. Obtain archived tweets by requesting to download your Twitter data.
    You can extract tweet.js file from the downloaded .zip file.
@romainl
romainl / ctagsd
Last active March 14, 2024 14:05
Run ctags upon file change/addition/deletion in a Git repository
#!/usr/bin/env sh
# Requirements:
# git: https://git-scm.com/downloads
# entr: http://eradman.com/entrproject/
# ctags: http://ctags.sourceforge.net/ (Exuberant Ctags) or https://ctags.io/ (Universal Ctags)
# Usage:
# $ cd my_project
# $ ctagsd