Skip to content

Instantly share code, notes, and snippets.

@mcany
mcany / gist:3c517c9327cf23a832980b8d38ba6152
Created September 18, 2020 12:03
lipo framwork extract
FRAMEWORK="${TARGET_BUILD_DIR}/${WRAPPER_NAME}/Frameworks/**.framework"
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
@mcany
mcany / app.dart
Last active May 27, 2021 04:23
New Flutter Project with Bloc
export 'app_bloc.dart';
export 'app_event.dart';
export 'app_state.dart';
export 'app_route.dart';
#bin/bash
set -e
set -o pipefail
# Run SwiftLint
START_DATE=$(date +"%s")
SWIFT_LINT=/usr/local/bin/swiftlint
SWIFT_LINT_YAML=.swiftlint.yml
The final interface is as simple as this:
image.scaled(to: size)
image.scaled(to: size, scalingMode: .aspectFill)
image.scaled(to: size, scalingMode: .aspectFit)
.. and is implemented like this:
// MARK: - Image Scaling.
extension UIImage {
@mcany
mcany / sublime
Last active May 17, 2023 12:07
terminal/sublime preferences
{
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"font_size": 18,
"ignored_packages":
[
"Vintage"
],
"show_encoding": true
}
extension Bool {
init<T : IntegerType>(_ integer: T) {
if integer == 0 {
self.init(false)
} else {
self.init(true)
}
}
}
- (void)pulseAnimationTo:(UIView *)view duration:(float)duration toValue:(float)toValue repeatCount:(float)repeatCount {
CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
pulseAnimation.duration = duration;
pulseAnimation.toValue = [NSNumber numberWithFloat:toValue];
pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
pulseAnimation.autoreverses = YES;
pulseAnimation.repeatCount = repeatCount;
[view.layer addAnimation:pulseAnimation forKey:nil];
}
@property (copy, nullable) NSString *name;
@property (copy, readonly, nonnull) NSArray *allItems;
- (nullable AAPLListItem *)itemWithName:(nonnull NSString *)name;
- (NSInteger)indexOfItem:(nonnull AAPLListItem *)item;
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
#!/bin/sh
git fetch --unshallow
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "development" ]; then
bundle exec fastlane upload env:sandbox type:appstore
bundle exec fastlane upload env:sandbox type:adhoc
echo Uploading build log...
curl -T ./build/logs/KapGelSandbox-KapGel\ Sandbox.log chunk.io
elif [ "$TRAVIS_BRANCH" == "master" ]; then