Skip to content

Instantly share code, notes, and snippets.

View agiletalk's full-sized avatar

chanju Jeon agiletalk

View GitHub Profile
{
"login": "agiletalk",
"avatar_url": "https://avatars2.githubusercontent.com/u/331528?v=4",
"name": "chanju Jeon",
"email": null,
"public_repos": 20,
"public_gists": 46,
"followers": 15,
"following": 23
}
protocol FeedItem: Codable {
var type: FeedType { get }
}
enum FeedType: String, Codable {
case job
case company
case content
case event
case theme
import Foundation
import UIKit
// Usage Examples
let shadowColor = Color.shadow.value
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5)
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value
enum Color {
import UIKit
@IBDesignable
class RoundedButton: UIButton {
@IBInspectable var cornerRadius: CGFloat = 0 {
didSet {
layer.cornerRadius = cornerRadius
layer.masksToBounds = cornerRadius > 0
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let duration = 2.0
let launchScreen = UIStoryboard(name: "LaunchScreen", bundle: nil)
let launchViewController = launchScreen.instantiateInitialViewController()
let imageView = launchViewController?.view.viewWithTag(100) as! UIImageView
imageView.image = UIImage.animatedImageNamed("win_", duration: duration)
self.window?.rootViewController = launchViewController
__author__ = 'agiletalk'
from math import factorial
print(eval("+".join(list(str(factorial(100))))))
__author__ = 'agiletalk'
from calendar import monthrange, SUNDAY
print(len([(year, month) for year in range(1901, 2001) for month in range(1, 13) if monthrange(year, month)[0] is SUNDAY]))
__author__ = 'agiletalk'
print(eval("+".join(list(str(pow(2,1000))))))
__author__ = 'agiletalk'
numbers = """
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
@agiletalk
agiletalk / ReselectableUISegmentedControl.m
Created May 22, 2014 07:21
ReselectableUISegmentedControl 터치 이벤트
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSInteger current = self.selectedSegmentIndex;
[super touchesBegan:touches withEvent:event];
if (current == self.selectedSegmentIndex)
[self sendActionsForControlEvents:UIControlEventValueChanged];
}