Skip to content

Instantly share code, notes, and snippets.

View seyhunak's full-sized avatar
🏆
Winning The Life

Seyhun Akyürek seyhunak

🏆
Winning The Life
View GitHub Profile
@seyhunak
seyhunak / DispatchGroup+Complete.swift
Created December 5, 2019 16:40 — forked from plummer/DispatchGroup+Complete.swift
DispatchGroup convenience wrapper for executing a series of blocks concurrently
import Foundation
extension DispatchGroup {
/// Completes a series of blocks and finally executes a completion handler.
///
/// - Parameters:
/// - label: An optional DispatchQueue label (defaults to bg)
/// - qos: An optional DipatchQos (defaults to background)
/// - blocks: The series of blocks to call.
@seyhunak
seyhunak / git-clearHistory
Created August 30, 2019 21:25 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@seyhunak
seyhunak / web-servers.md
Created December 12, 2017 19:47 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@objc protocol Refreshable
{
/// The refresh control
var refreshControl: UIRefreshControl? { get set }
/// The table view
var tableView: UITableView! { get set }
/// the function to call when the user pulls down to refresh
@objc func handleRefresh(_ sender: Any);
@seyhunak
seyhunak / AppDelegate.swift
Created June 5, 2016 16:45
Yet another GitHub sign in screen using MVVM
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
let viewModel = LoginViewModel(provider: GitHubProvider)
let loginViewController = R.storyboard.main.loginViewController!
loginViewController.viewModel = viewModel
if let window = window {
window.rootViewController = loginViewController
window.makeKeyAndVisible()
@seyhunak
seyhunak / introrx.md
Created October 11, 2015 10:44 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@seyhunak
seyhunak / brewMVVM.swift
Created October 11, 2015 10:42 — forked from vasarhelyia/brewMVVM.swift
Brew MVVM
class Brew {
var temp: Float = 0.0
}
class BrewViewModel : NSObject {
var brew = Brew()
dynamic var temp: Float = 0.0 {
didSet {
self.brew.temp = temp
}

Videos

//
// UDWrapper.swift
// DMS
//
// Created by Freddy on 12/18/14.
// Copyright (c) 2014 DMSCompany. All rights reserved.
//
import Foundation
#!/bin/bash
main() {
if [[ $(has_lvh_me) == 1 ]]; then
echo 'lvh.me is already specified in your hosts file'
else
add_lvh_me
echo 'lvh.me was added to your hosts file!'
fi
flush_dns_cache