Skip to content

Instantly share code, notes, and snippets.

@mcany
mcany / .gitconfig
Last active August 10, 2016 13:44 — forked from salimkayabasi/.gitconfig
[user]
email = mcanyigin@gmail.com
name = Mertcan YIGIN
[core]
autocrlf = true
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
[color]
diff = auto
status = auto
branch = auto
# 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
language: objective-c
osx_image: xcode8
sudo: true
before_install:
# There is a bug in travis. When using system ruby, bundler is not
# installed and causes the default install action to fail.
- gem install bundler
- brew install graphicsmagick
script:
- ./scripts/travis.sh
#!/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
# 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
@property (copy, nullable) NSString *name;
@property (copy, readonly, nonnull) NSArray *allItems;
- (nullable AAPLListItem *)itemWithName:(nonnull NSString *)name;
- (NSInteger)indexOfItem:(nonnull AAPLListItem *)item;
- (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];
}
extension Bool {
init<T : IntegerType>(_ integer: T) {
if integer == 0 {
self.init(false)
} else {
self.init(true)
}
}
}
@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
}
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 {