Skip to content

Instantly share code, notes, and snippets.

View durul's full-sized avatar

durul dalkanat durul

View GitHub Profile
@durul
durul / beer
Last active July 12, 2016 12:59
beer.json
{
"beers" : [
{
"brewery" : {
"id" : 1,
"name" : "(512) Brewing Company"
},
"id" : 1,
"created_at" : "2010-12-07T02:53:38Z",
"abv" : 6,
@durul
durul / SearchManager.playground
Last active December 29, 2016 20:53
BinarySearch & LinearSearch
import UIKit
import XCPlayground
import Foundation
func makeArr(n: Int) -> [Int] {
var res = [Int]()
for _ in 0..<n {
res.append(Int(arc4random_uniform(10000) + 1))
}
// Write three functions that compute the sum of the numbers in a given list using a for-loop, a while-loop.
// Part 2
var series = [1, 2, 3, 4, 5, 6]
let realSum = series.reduce(0,{$0 + $1})
// Normal Closure
var timesTenClosure: (Int) -> Int = { $0 * 10 }
// Problem 1
# platform :ios, '10.0'
use_frameworks!
target 'combat' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for combat
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => ‘4.4.0’
pod 'PINRemoteImage', '~> 2.1'
pod 'BRYXBanner', :git => 'https://github.com/bryx-inc/BRYXBanner.git', :tag => ‘0.7.1’
@durul
durul / ThemeManager.swift
Created April 28, 2017 19:23
ThemeManager.swift
//
// ThemeManager.swift
import UIKit
import Foundation
/// Enum Theme Manager
/// - Note: https://github.com/durul/DRL-Theme-Manager
enum Theme: Int {
@durul
durul / Xcode Defaults.md
Last active April 25, 2025 19:01
Xcode Defaults

Xcode Defaults

Command Line

# Enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

# Enable project build time
@durul
durul / brew-java-and-jenv.md
Created October 29, 2017 19:05 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@durul
durul / remove_brew-mongo_osx.sh
Created February 11, 2018 01:16 — forked from katychuang/remove_brew-mongo_osx.sh
remove mongodb that was installed via brew
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
@durul
durul / List out all the subviews.swift
Last active July 7, 2018 18:15
List out all the subviews in a UIViewcontroller
extension UIView {
private var viewInfo: String {
return "\(classForCoder), frame: \(frame))"
}
private func subviews(parentView: UIView, level: Int = 0, printSubviews: Bool = false) -> [UIView] {
var result = [UIView]()
if level == 0 && printSubviews {
result.append(parentView)
@durul
durul / System Design.md
Created July 29, 2024 01:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?