Skip to content

Instantly share code, notes, and snippets.

View SuperY's full-sized avatar
🎯
Focusing

SuperY SuperY

🎯
Focusing
View GitHub Profile
@SuperY
SuperY / README-Template.md
Created January 11, 2019 02:47 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@SuperY
SuperY / git-tag-delete-local-and-remote.sh
Created June 28, 2018 02:14 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
import Foundation
// Inspired by https://gist.github.com/mbuchetics/c9bc6c22033014aa0c550d3b4324411a
struct JSONCodingKeys: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
@SuperY
SuperY / Client.swift
Created December 12, 2017 10:34 — forked from kean/Client.swift
import Foundation
import Alamofire
import RxSwift
import RxCocoa
protocol ClientProtocol {
func request<Response>(_ endpoint: Endpoint<Response>) -> Single<Response>
}
extension PHPhotoLibrary {
typealias PhotoAsset = PHAsset
typealias PhotoAlbum = PHAssetCollection
static func saveImage(image: UIImage, albumName: String, completion: (PHAsset?)->()) {
if let album = self.findAlbum(albumName) {
saveImage(image, album: album, completion: completion)
return
}
@SuperY
SuperY / NavigationPushDoneTodo
Created May 19, 2016 09:04
UINavigationController push viewController do some function On main thread
CATransaction.begin()
self.navigationController?.pushViewController(self.connectingViewController, animated: true)
CATransaction.setCompletionBlock({
dispatch_async(dispatch_get_main_queue(),{
self.connectingViewController.doSomeThing()
})
})
CATransaction.commit()
@SuperY
SuperY / private.xml
Last active August 29, 2015 14:19 — forked from eamesliu/private.xml
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@SuperY
SuperY / ATableCell
Last active August 29, 2015 14:14
TableView Cell Animation
@implementation ATableCell
- (void)awakeFromNib{}
- (void)startAnimationWithDelay:(CGFloat)delayTime{
_tipView.transform = CGAffineTransformMakeTranslation(SCREENWIDTH, 0);
[UIView animateWithDuration:1. delay:delayTime usingSpringWithDamping:0.6 initialSpringVelocity:0
option:0
animations:^{
self.tipView.transform = CGAffineTransformIdentity;
}
#import <UIKit/UIKit.h>
@interface UIView (TLLayout)
@property (nonatomic, strong) NSArray *hiddenConstraints;
// set hidden and remove any constraints involving this view from its superview
- (void)hideAndRemoveConstraints;
- (void)showAndRestoreConstraints;
//
// UINavigationBar+CustomHeight.h
//
// Copyright (c) 2014 Maciej Swic
//
// 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