Skip to content

Instantly share code, notes, and snippets.

View CodeEagle's full-sized avatar
🎹
Laugh

CodeEagle CodeEagle

🎹
Laugh
View GitHub Profile
@importRyan
importRyan / whenHovered.md
Last active May 9, 2024 00:57
Reliable SwiftUI mouse hover

Reliable mouseEnter/Exit for SwiftUI

Kapture 2021-03-01 at 14 43 39

On Mac, SwiftUI's .onHover closure is not always called on mouse exit, particularly with high cursor velocity. A grid of targets or with finer target shapes will often have multiple targets falsely active after the mouse has moved on.

It is easy to run back to AppKit's safety. Below is a SwiftUI-like modifier for reliable mouse-tracking. You can easily adapt it for other mouse tracking needs.

import SwiftUI
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 9, 2024 22:00
Files for PlayStation BIOS Files NA-EU-JP
@paulnbrd
paulnbrd / babelEdit_trial_bypass.py
Last active March 9, 2023 08:52
Trial of BabelEdit expired ? Execute this program, and the trial will be renewed !
import os
try :
import winreg
except :
print("You need winreg.")
print("(pip install winregistry)")
os._exit(0)
REG_PATH = r"SOFTWARE\code-and-web.de\BabelEdit\licensing"
def set_reg(name, value):
try:
@mattadatta
mattadatta / CollectionView.swift
Last active May 10, 2024 14:29
UIKit's UICollectionView implemented in SwiftUI using UIViewControllerRepresentable
//
// (See usage below implementation)
//
// SwiftUI `CollectionView` type implemented with UIKit's UICollectionView under the hood.
// Requires `UIViewControllerRepresentable` over `UIViewRepresentable` as the type that allows
// for SwiftUI `View`s to be added as subviews of UIKit `UIView`s at all bridges this gap as
// the `UIHostingController`.
//
// Not battle-tested yet, but seems to be working well so far.
// Expect changes.
@Thong-Tran
Thong-Tran / README.md
Last active May 23, 2023 05:53
Set up auto build and distribute flutter app on Appcenter

Auto deploying flutter app via Appcenter

Configure project

  • Active AndroidX if it isn’t already.
  • Create and checkout to new branch (appcenter currently only listen trigger from commit code on branch)
  • Setup android:
    • Comment those lines in file android/.gitignore

gradle-wrapper.jar

@warpling
warpling / UIBezierPath+AttributedString.swift
Last active January 10, 2023 05:22
AttributedString to UIBezierPath
extension UIBezierPath {
// Source: https://github.com/aderussell/string-to-CGPathRef/blob/0bd9350dc2100029f3ddb8d9667384841549ecd6/ARCGPathFromString/ARCGPathFromString.m
convenience init(attributedString: NSAttributedString) {
let letters = CGMutablePath()
let line = CTLineCreateWithAttributedString(attributedString as CFAttributedString)
let runArray = CTLineGetGlyphRuns(line)
@Fusseldieb
Fusseldieb / unlimited_trials_babeledit.txt
Last active March 25, 2024 08:26
Activate BabelEdit temporarily / Unlimited trial
/////////////////////////////////////////////////////////
As others have mentioned:
This workaround only works for versions 2.*
In other words: It's outdated and doesn't work anymore
Scroll down for community posts!
/////////////////////////////////////////////////////////
Original gist:
Obviously for educative purposes only.
@plateaukao
plateaukao / image_remove_backgroun.dart
Created April 13, 2019 05:18
image remove background in flutter
Future<Uint8List> _downloadImage() async {
String dir = (await getApplicationDocumentsDirectory()).path;
File file = new File('$dir/$_filename');
if (file.existsSync()) {
var image = await file.readAsBytes();
return image;
} else {
var response = await http.get(_url,);
var bytes = response.bodyBytes;
@filiph
filiph / main.dart
Last active September 11, 2019 00:52
Implementation of the ring of circles in Flutter. Initial inspiration: https://twitter.com/InfinityLoopGIF/status/1101584983259533312. Kotlin implementation: https://gist.github.com/alexjlockwood/e3ff7b9a05dd91ff0955b90950bf7ee5
import 'package:flutter/material.dart';
import 'package:ring_of_circles/src/widget.dart';
/// Just the app. Nothing to see here, except the code for changing
/// the number of circles (`n`).
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ansonyao
ansonyao / RealmObjectCodable.swift
Last active November 12, 2021 09:31
Realm Object Extension for Codable (RealmOptional and Realm List)
//
// RealmSwift+Codable.swift
//
// Created by Anson Yao on 7/25/18.
//
//Adding this file can make your classes inherited from Realm Object comfirm to Codable easily
//Inspired by @mishagray https://gist.github.com/mishagray/3ee82a3a82f357bfbf8ff3b3d9eca5cd