Skip to content

Instantly share code, notes, and snippets.

View erenkabakci's full-sized avatar

Eren Kabakçı erenkabakci

  • Berlin
View GitHub Profile
@erenkabakci
erenkabakci / UserNotificationsHandling.swift
Last active May 2, 2023 22:09
UserNotificationsHandling
//
// UserNotificationsHandling.swift
//
// Copyright © 2023 Eren Kabakci. All rights reserved.
//
import UserNotifications
import AppKit
// Generic local notifications API for any consumer to use
final class DepotViewModel: ObservableObject {
@Published searchPresented: Bool = false
func presentSearch() {
showSearch = true
}
}
struct DepotOverviewView: View {
final class DepotViewModel: BaseViewModel<DepotViewModel.State, DepotViewModel.Action> {
struct State: Equatable, Copyable {
var showSearch = false
}
enum Action {
case .openSearch(let show):
showSearch(show: show)
@erenkabakci
erenkabakci / Apple resigning an ipa
Created June 10, 2020 17:19 — forked from phatfly/Apple resigning an ipa
Resigning an iOS xcarchive for the app store (xcarchive to ipa)
Resigning an iOS ipa for the app store
Introduction
Friday, October 18, 2019
For the release of company iOS applications to the Apple app store we need to resign those apps with our appropriate distribution certificate. This is the process you need to follow, as-of-this-writing, to properly re-sign an foo.ipa to upload to Apple using the Application Loader.
This writing is making the assumption that the foo.ipa bundle that you has been created appropriately and that is only needs to be resigned.
@erenkabakci
erenkabakci / PublishersPlayground.swift
Last active February 20, 2020 16:27
PublishersPlayground
import Combine
import Foundation
struct SomeError: Error {}
// 1- Subject scenarios
let currentValueSubject = CurrentValueSubject<String, Error>("foo")
let passThroughSubject = PassthroughSubject<String, Error>()
currentValueSubject.send("Loo") // receiveValue of the subscriber will be called when "sink", receiveCompletion won't be called, the subscription is still active
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
####### set custom path ##############
export PATH=$PATH:~/bin
export PATH=$PATH:~/usr/local
######################################
# export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home'
@erenkabakci
erenkabakci / pre-push
Created October 18, 2017 10:36
Git pre-push hook to remind incrementing the build version
#!/bin/sh
echo " ++++++++ DID YOU INCREASE THE BUILD NUMBER ? ++++++++"
exec < /dev/tty
read input
if [ "$input" == "y" ]; then
exit 0
else
echo "Running hook for build increment"
@erenkabakci
erenkabakci / playground.swift
Last active May 23, 2017 14:24
Value vs Reference Type in Swift
//: Playground - noun: a place where people can play
// Value Type
struct StructA {
var field1: String = "Default Struct Value"
let field2: Int = 1
}
let constantStruct = StructA()
@erenkabakci
erenkabakci / .gitconfig
Last active April 27, 2017 14:55
.gitconfig
[core]
excludesfile = /Users/erenkabakci/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[pull]
rebase = true
@erenkabakci
erenkabakci / .bash_profile
Last active December 12, 2018 12:36
.bash_profile
####### set custom path ##############
export PATH=$PATH:~/bin
export PATH=$PATH:~/usr/local
########### terminal convenience #############
alias ls='ls -G'
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="🤘 \[\033[01;35m\]\u:\[\033[01;34m\]\W:\[\033[01;34m\]\[\033[01;32m\]\$(parse_git_branch)\$ \[\e[0m\]"