Skip to content

Instantly share code, notes, and snippets.

View tolpp's full-sized avatar
😎

Tolga Okur tolpp

😎
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tolpp on github.
  • I am tolgaokur (https://keybase.io/tolgaokur) on keybase.
  • I have a public key ASCpXTRypjxCpP4j3Jn90AVsZklxi0XZNOQrRwZWKZ98lAo

To claim this, I am signing this object:

@tolpp
tolpp / xcode8-swift2.3-cocapods.podfile.rb
Created July 14, 2016 14:35
CocoaPods Podfile post_install script for adding swift_version property to targets or pod_project. You can use this post_install script if you are working with pods that not compatible with Swift 3.0.
# set true if all pods in the pod_project needs to be flaggged as swift 2.3
legacy_swift_pods_project = true
# Array for pods that will be flagged as swift version 2.3
# if legacy_swift_pods_project is true, you don't need to add any item in array.
legacy_swift_pods = ['Alamofire']
post_install do |installer|
if legacy_swift_pods_project
installer.pods_project.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
@tolpp
tolpp / usefull-hackernews-chrome-extensions.txt
Last active July 14, 2016 14:59
Useful HN Chrome Extensions
Georgify :
https://chrome.google.com/webstore/detail/georgify/ofjfdfaleomlfanfehgblppafkijjhmi
Hacker News Collapsible Comments :
https://chrome.google.com/webstore/detail/hacker-news-collapsible-c/hockhafcdegocajmjhafgjncjpodihkd
Hacker News: Mark All Read :
https://chrome.google.com/webstore/detail/hacker-news-mark-all-read/ogfbcfkihdkplelnaenpgkhnkpoaggjc
/// instantiates component from storyboard by given storyboard name and identifier
protocol IBInstantiatable {
/// Storyboard name that component designed in
static var storyboardName : String {get}
/// component identifier that assigned to component in storyboard
///
/// `Identity -> Storyboard ID`
static var identifier : String {get}
}
import ObjectiveC
private var xoAssociationKey: UInt8 = 0
extension UIView {
var xo: PFObject! {
get {
return objc_getAssociatedObject(self, &xoAssociationKey) as? PFObject
}
set(newValue) {
//
// ConstraintsWithVisualFormatList.swift
//
import UIKit
extension NSLayoutConstraint {
/// - returns : `NSLayoutConstraint` array which is generated from visual format string array
class func constraintsWithVisualFormatList(formats: [String],
options: NSLayoutFormatOptions = NSLayoutFormatOptions(rawValue: 0),
@tolpp
tolpp / FirstViewController.swift
Last active September 21, 2015 06:35
UIViewControllerAnimatedTransitioning simple usage. Source : http://gist.tolpp.com/2015/09/swift-uiviewcontrolleranimatedtransitio.html
import UIKit
class FirstViewController: UIViewController {
var secondVc : SecondViewController!
override func viewDidLoad() {
super.viewDidLoad()
}
let sb = UIStoryboard(name: "StoryBoardNameThatContainsCustomViewController", bundle: nil)
customVc = sb.instantiateViewControllerWithIdentifier("CustomViewControllerID") as! CustomViewController
//Animasyonlar için özelleştirilmiş geçişler kullanılmak isteniyorsa :
//customVc.transitioningDelegate = self
self.presentViewController(customVc, animated: true, completion: nil)
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
public class PropertiesMain {
/**
* @param args
public class Euclid {
static int iterativeGCD(int m, int n){
while(n != 0){
int r = m % n;
m = n;
n = r;
}
return m;
}