This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xcode-icon-tag.sh | |
# The MIT License (MIT) | |
# | |
# Copyright (c) <2015> <Valerio Mazzeo> | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - Standard Methods Extensions | |
- (NSMutableURLRequest *)multipartFormRequestAtPathForRelationship:(NSString *)relationshipName | |
ofObject:(id)object | |
method:(RKRequestMethod)method | |
path:(NSString *)path | |
parameters:(NSDictionary *)parameters | |
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block | |
{ | |
RKRoute *route = [self.router.routeSet routeForRelationship:relationshipName ofClass:[object class] method:method]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
self.label = [[UILabel alloc] initWithFrame:CGRectZero]; | |
self.label.translatesAutoresizingMaskIntoConstraints = NO; | |
self.label.backgroundColor = [UIColor redColor]; | |
self.label.textAlignment = NSTextAlignmentCenter; | |
self.label.numberOfLines = 0; | |
self.label.text = @"Valerio adjkashdjk asdjk asd adj aklsdjasl dkjasdkl askldj aklsdj aklsddj aklsdj aklsdjaklsdj aklsdj aklsd Tiziano."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface TView : UITextView | |
@property (nonatomic) CGFloat preferredMaxLayoutWidth; | |
@end | |
@implementation TView | |
- (instancetype)initWithFrame:(CGRect)frame | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIScrollView+Parallax.swift | |
// Parallax | |
// | |
// Created by Valerio Mazzeo on 20/05/2016. | |
// Copyright © 2016 Valerio Mazzeo. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewAdapter.swift | |
// | |
// Created by Valerio Mazzeo on 10/08/2016. | |
// Copyright © 2016 Valerio Mazzeo. All rights reserved. | |
// | |
import UIKit | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
open class PercentDrivenInteractiveTransition: NSObject { | |
// MARK: Initialization | |
public required init(animator: UIViewControllerAnimatedTransitioning) { | |
self.animator = animator | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class PageViewController: UIViewController { | |
// MARK: Initialization | |
public required init(viewControllers: [UIViewController]) { | |
self.viewControllers = viewControllers | |
super.init(nibName: nil, bundle: nil) | |
} | |
public required init?(coder aDecoder: NSCoder) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'octokit' | |
options = {} | |
OptionParser.new do |opt| | |
opt.on('-s', '--secret SECRET', 'GitHub access token') { |o| options[:secret] = o } | |
opt.on('-r', '--repo-slug REPO_SLUG', 'Repo slug. i.e.: apple/swift') { |o| options[:repo_slug] = o } | |
opt.on('-c', '--changelog-file CHANGELOG_FILE', 'Changelog path') { |o| options[:changelog_file] = o } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPO_NAME=myorg/myrepo | |
# get token from Docker Hub | |
DOCKER_HUB_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_HUB_USERNAME}'", "password": "'${DOCKER_HUB_PASSWORD}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) | |
# get tags for repo | |
IMAGE_TAGS=$(curl -s -H "Authorization: JWT ${DOCKER_HUB_TOKEN}" https://hub.docker.com/v2/repositories/${REPO_NAME}/tags/?page_size=10000 | jq -r '.results|.[]|.name') | |
# generate a file containing each version on a new line excluding latest | |
printf '%s\n' ${IMAGE_TAGS#latest} > versions |
OlderNewer