Skip to content

Instantly share code, notes, and snippets.

Andrey Filipenkov kambala-decapitator

View GitHub Profile
showUsage() {
echo "usage: $(basename "$0") --app_identifier APP_ID --app_name APP_NAME [--group_name GROUP_NAME] [--username USERNAME] [--team_id TEAM_ID] [--team_name TEAM_NAME]"
if [[ $# -eq 0 ]]; then
exit 1
kambala-decapitator /
Last active Apr 8, 2020
bash script to sign iOS/tvOS Kodi
#!/usr/bin/env bash
# required:
# KODI_PATH - path to Kodi app that will be resigned, can be deb / ipa / app
# PROVISIONING_PROFILE - path to provisioning profile
# CODE_SIGN_IDENTITY - certificate name, e.g. 'iPhone Developer: ***'
# optional:
# OUT_DIR - where to save the resulting file
# PACKAGE_IPA - set to 1 to create .ipa file instead of plain .app
kambala-decapitator / gist:e298761e57d4031c65c4e39df5002ef6
Created Apr 5, 2020
fastlane: execute lanes from different platforms in a single lane
View gist:e298761e57d4031c65c4e39df5002ef6
desc "All App Store Connect"
lane :appStoreConnect do #|options|
self.runner.current_platform = :ios
self.runner.current_platform = :tvos
# the following executes before_all every time
kambala-decapitator /
Last active Jan 15, 2020
sign and notarize existing Kodi .dmg's
#!/usr/bin/env fish
set kodiRepo "$HOME/dev/kodi/macos"
set -x CODE_SIGN_IDENTITY "Developer ID Application: Kodi Foundation"
# fixed params
set kodiVolume /Volumes/Kodi
kambala-decapitator / spaceWidth.swift
Created Jul 9, 2019
retrieve width of space character and compute how many spaces are required to fill the gap
View spaceWidth.swift
let spaceWidth = { () -> Double in
let font = self.font!
var spaceGlyph = CGGlyph()
var space: UniChar = numericCast((" " as Unicode.Scalar).value)
_ = CTFontGetGlyphsForCharacters(font, &space, &spaceGlyph, 1)
return CTFontGetAdvancesForGlyphs(font, .horizontal, &spaceGlyph, nil, 1)
// to be called from func layoutManager(_ layoutManager: NSLayoutManager, shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer<CGRect>, lineFragmentUsedRect: UnsafeMutablePointer<CGRect>, baselineOffset: UnsafeMutablePointer<CGFloat>, in textContainer: NSTextContainer, forGlyphRange glyphRange: NSRange)
let addSpaces = Int(Double(lineFragmentRect.pointee.maxX - lineFragmentUsedRect.pointee.maxX) / spaceWidth)
kambala-decapitator / gist:28e7666434e680a6e324d600cb76caab
Created Jun 13, 2019
objc code used to show screen properties of iOS device
View gist:28e7666434e680a6e324d600cb76caab
- (void)viewDidLoad {
[super viewDidLoad];
__auto_type appLabel = [UILabel new];
appLabel.translatesAutoresizingMaskIntoConstraints = NO;
appLabel.text = NSBundle.mainBundle.executablePath.lastPathComponent;
[self.view addSubview:appLabel];
__auto_type createLabel = ^{
__auto_type l = [UILabel new];
kambala-decapitator / qrisk2015.cpp
Created Apr 16, 2018
Batch processing of health data using QRISK®2-2015 algorithm
View qrisk2015.cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <cmath>
#include <cstring>
using std::string;
kambala-decapitator / FSTraversal.m
Created Apr 16, 2018
Small macOS CLI program to list filesystem items
View FSTraversal.m
// main.m
// FSTraversal
// Created by Andrey Filipenkov on 03/03/17.
// Copyright © 2017 Andrey Filipenkov. All rights reserved.
@import Foundation;
import plistlib
# Read Plists
myAppInfoPlist = plistlib.readPlist(“MyApp/Info.plist”)
watchKitExtensionInfoPlist = plistlib.readPlist(“WatchKitExtension/Info.plist”)
watchKitAppInfoPlist = plistlib.readPlist(“WatchKitApp/Info.plist”)
# Update Watch Kit Extension Plist
watchKitExtensionInfoPlist[“NSExtension”][“NSExtensionAttributes”][“WKAppBundleIdentifier”] = watchKitAppInfoPlist[“CFBundleIdentifier”]
watchKitExtensionInfoPlist[“CFBundleVersion”] = myAppInfoPlist[“CFBundleVersion”]
kambala-decapitator / fixXcodePlugins
Last active Aug 29, 2015
simple shell script to quickly add new UUID to custom Xcode plugins
View fixXcodePlugins
cd "${HOME}/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
for plugin in *.xcplugin; do
/usr/libexec/PlistBuddy -c "Add :DVTPlugInCompatibilityUUIDs: string $1" "${plugin}/Contents/Info.plist"
You can’t perform that action at this time.