Skip to content

Instantly share code, notes, and snippets.

View kaanbiryol's full-sized avatar
🦎
adapting

Kaan Biryol kaanbiryol

🦎
adapting
View GitHub Profile
#!/usr/bin/env bash
# ./match_p12.sh private.p12 CertificateSigningRequest.certSigningRequest
# if you see any errors it is likely that the p12 and csr do not match (openssl returns a specific hash for empty values which might cause them to look like they are equal)
if [ $# -ne 2 ]; then
echo "Usage: $0 <p12_file> <csr_file>"
echo "Example: $0 exported_key.p12 CertificateSigningRequest.certSigningRequest"
exit 1
fi
@kaanbiryol
kaanbiryol / coverage.rb
Created December 22, 2023 10:29
coverage.rb
#!/usr/bin/env ruby
require 'json'
class CoverageInfo
attr_accessor :filename, :regions, :missed_regions, :region_coverage, :functions, :missed_functions, :executed, :lines, :missed_lines, :line_coverage, :branches, :missed_branches, :branch_coverage
def initialize(data)
@filename = data[0]
@regions = data[1]
@missed_regions = data[2]
@region_coverage = data[3]
@kaanbiryol
kaanbiryol / post-checkout
Created July 7, 2023 14:03
git-worktree for post-checkout
#!/usr/bin/env ruby
current_branch = `git symbolic-ref --short HEAD`.strip
target_branch = ARGV[0]
if current_branch != target_branch
repository_path = Dir.getwd
worktree_name = repository_path + "-worktree-#{target_branch.gsub('/', '_')}"
@kaanbiryol
kaanbiryol / make.sh
Created April 21, 2021 19:28
run custom shell command from xcode
#! /bin/bash
projectPath="$(dirname $XcodeProjectPath)"
osascript -e 'on run {projectPath}' -e 'tell app "Terminal"
activate
do script "killall Xcode && cd '$projectPath' && make project" in window 1
end tell' -e 'end run' $projectPath
@kaanbiryol
kaanbiryol / appIconGenerator.py
Created December 14, 2020 18:05
App Icon Generator
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import sys
import os
envText, versionText = sys.argv[1:]
path = "Project/Assets.xcassets/AppIcon.appiconset"
@kaanbiryol
kaanbiryol / appstore.plist
Last active December 14, 2020 18:06
Upload to TestFlight
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>provisioningProfiles</key>
<dict>
<key>com.yourProdBundle</key>
<string>YOUR_PROD_PROVISIONING_FILE</string>
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAMID.bundleID",
"paths": [
"/login/*",
"/register/*",
"/loginWithSms/*"
import Foundation
func separated(by character: Character, for string: String?) -> String? {
guard let string = string else { return nil }
return String(string.split(separator: character)[0])
}
func generateStrings(_ inputPath: String, _ outputPath: String) {
var outputString = """
//
import os
import re
def find_between( s, first, last ):
try:
start = s.index( first ) + len( first )
end = s.index( last, start )
return s[start:end]
except ValueError:
return ""
@kaanbiryol
kaanbiryol / DisposeBag.swift
Created September 15, 2020 12:15
Observable
protocol Disposable {
func dispose()
}
public class DisposeBag {
public init() {}
private var observables: [Disposable]? = []