Skip to content

Instantly share code, notes, and snippets.

View emndeniz's full-sized avatar

Emin DENİZ emndeniz

View GitHub Profile
@emndeniz
emndeniz / DeleteSimulatorsByVersion.sh
Created January 31, 2025 07:53
This file has command to delete old simulators for specific version
# The command below will delete all iOS 18.0 simulators you have. You can replace "18.0" with any version you prefer.
xcrun simctl list devices | sed -n '/-- iOS 18.0 --/,/^--/p' | grep -oE '[0-9A-F\-]{36}' | xargs -n 1 xcrun simctl delete
# You can use same command for watchOS and tvOS simulators.
xcrun simctl list devices | sed -n '/-- watchOS 11.0 --/,/^--/p' | grep -oE '[0-9A-F\-]{36}' | xargs -n 1 xcrun simctl delete
@emndeniz
emndeniz / DownloadAppStoreReviews.py
Last active November 27, 2024 14:51
DownloadAppStoreReviews.py
import requests
import json
import csv
def get_reviews(app_id, jwt_token, fetch_all):
url = f"https://api.appstoreconnect.apple.com/v1/apps/{app_id}/customerReviews?limit=200&sort=-createdDate"
headers = {
"Authorization": f"Bearer {jwt_token}"
}
@emndeniz
emndeniz / JWTTokenGeneratorForAppStoreConnect.py
Created June 17, 2024 11:05
JWTTokenGeneratorForAppStoreConnect.py
import jwt
import time
def generate_token(key_id, issuer_id, private_key_path):
with open(private_key_path, 'r') as key_file:
private_key = key_file.read()
headers = {
"alg": "ES256",
"kid": key_id
@emndeniz
emndeniz / PreCommitHook.sh
Last active September 13, 2023 11:53
PreCommitHook for SwiftLint
#!/bin/bash
# COLOR codes to use in logs
RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# LOG tag of file
@emndeniz
emndeniz / QoSTable.csv
Last active February 24, 2023 13:45
QoSTable
house leader seat
Stark Jon Snow Winterfell
Lannister Cersei Lannister Kings Landing
Targaryen Daenerys Targaryen Dragonstone
Greyjoy Pyke Euron Greyjoy
@emndeniz
emndeniz / Countries-AllCountriesSuccessResponse.json
Created September 19, 2022 14:05
AllCountriesSuccessResponse
[
{
"name": {
"common": "Bulgaria",
"official": "Republic of Bulgaria",
"nativeName": {
"bul": {
"official": "Република България",
"common": "България"
}
import Foundation
class MockURL: URLProtocol {
static var requestHandler: ((URLRequest) throws -> (HTTPURLResponse, Data?))?
override class func canInit(with request: URLRequest) -> Bool {
// To check if this protocol can handle the given request.
return true
import Foundation
/// This is a helper class for Unit Tests to load required response
class JSONTestHelper {
/// Reads local json file from test resources
/// - Parameter name: File name without extension
/// - Returns: Data represantation of file
// For All countries
let serviceProvider: ServiceProvider<AllCountriesServices> = ServiceProvider<AllCountriesServices>()
serviceProvider.request(service: .all, decodeType: AllCountriesResponseModel.self) { result in
switch result {
case .success(let data):
print(data)
case .failure(let error):
print(error)
@emndeniz
emndeniz / Countries-CountryResponseModel.swift
Created September 16, 2022 09:09
CountryResponseModel
import Foundation
// MARK: - CountryResponseModelElement
struct CountryResponseModelElement: Codable {
let name: Name?
let tld: [String]?
let cca2, ccn3, cca3, cioc: String?
let independent: Bool?
let status: String?
let unMember: Bool?