Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Super_Y SuperY

🎯
Focusing
View GitHub Profile
@SuperY
SuperY / README-Template.md
Created Jan 11, 2019 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.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 Jun 28, 2018 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# 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
View Decode Array<Any> and Dictionary<String, Any> Swift
import Foundation
// Inspired by https://gist.github.com/mbuchetics/c9bc6c22033014aa0c550d3b4324411a
struct JSONCodingKeys: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
View Client.swift
import Foundation
import Alamofire
import RxSwift
import RxCocoa
protocol ClientProtocol {
func request<Response>(_ endpoint: Endpoint<Response>) -> Single<Response>
}
View PHPhotoLibrary+PhotoAsset.swift
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
UINavigationController push viewController do some function On main thread
View NavigationPushDoneTodo
CATransaction.begin()
self.navigationController?.pushViewController(self.connectingViewController, animated: true)
CATransaction.setCompletionBlock({
dispatch_async(dispatch_get_main_queue(),{
self.connectingViewController.doSomeThing()
})
})
CATransaction.commit()
View 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 Aug 29, 2015
TableView Cell Animation
View ATableCell
@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;
}
View UIView+TLLayout.h
#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;
View UINavigationBar+CustomHeight.h
//
// 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
You can’t perform that action at this time.