Skip to content

Instantly share code, notes, and snippets.

View rogerluan's full-sized avatar
🚀

Roger Oba rogerluan

🚀
View GitHub Profile
@firegate666
firegate666 / Fastfile
Last active June 8, 2021 08:36
Example of how to upload app previews from an ordered structure the apple app store by using Fatland and Spaceship
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@pd95
pd95 / AppIcons.command
Last active December 28, 2022 20:56
A ZSH command file to produce the various PNG files required for iOS and macOS app Icons using `sips` (scriptable image processing system) available on any macOS. The resulting PNGs in the "AppIcons" folder can then be dragged into Xcode's `Assets.xcassets` onto a placeholder for an AppIcon.
#!/bin/zsh
# Shell Script to create all relevant icons from an high resolution artwork
if [ "x$1" != "x" -a -f "$1" ] ; then
INPUT=$1
else
INPUT="Artwork.png"
fi
if [ ! -f "$INPUT" ]; then
@closerminds
closerminds / post_archive_script.sh
Last active February 14, 2020 10:46
Swift 5 universal framework with workaround for Xcode10.2 issue #48635615
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@borut-t
borut-t / PannableViewController.swift
Last active August 23, 2021 03:33
PannableViewControllerTests
import UIKit
class PannableViewController: ViewController {
override func viewDidLoad() {
super.viewDidLoad()
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(panGesture(_:)))
view.addGestureRecognizer(panGesture)
}
}
@beginor
beginor / snowflake-id.sql
Last active April 18, 2024 20:13
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
@motokiee
motokiee / itc_status_slack_notification.gs
Last active November 13, 2023 04:23
Post iTunes Connect Status to Slack with Gmail using Google Apps Script
var mailAddress = "YOUR_EMAIL_ADDRSS";
var slackToken = "SLACK_TOKEN";
var searchMailQuery = 'SEARCH_QUERY'; // example: '[from:no_reply@email.apple.com YOUR_APP_NAME]';
var slackChannelId = "SLACK_CHANNEL_ID";
function getAttachment(message) {
var subject = message.getSubject();
var body = message.getPlainBody();
@mnem
mnem / man xccov
Last active October 4, 2021 12:10
xccov(1) xccov(1)
NAME
xccov - view Xcode coverage data in human-readable or machine-parseable format.
SYNOPSIS
xccov view [--only-targets | --files-for-target target_name | --functions-for-file name_or_path]
@niw
niw / ios11_uinavigationbar_behavior.md
Last active January 3, 2024 11:35
A note of my observation about iOS 11 UINavigationBar behavior.

UINavigationBar on iOS 11

NOTE This note is written based on Xcode version 9.0 beta 6 (9M214v) and its simulator binary.

iOS 11 changes UINavigationBar a lot, not just only for its large title, but also the internal view hierarchy and lay outing views are changed. This is a small note about UINavigationBar behavior on iOS 11, mainly focusing on migrating the application to iOS 11.

Lay outing views

UINavigationBar has been using manual lay outing until iOS 10, so all its content views like titleView has been directly child view of the UINavigationBar. However, since iOS 11, it is using auto layout with bunch of layout guides to lay out its content views in its own internal container view, _UINavigationBarContentView.

@RuiNelson
RuiNelson / Levenshtein.swift
Last active August 2, 2023 03:50
Levenshtein distance between two String for Swift 4.x
import Foundation
extension String {
subscript(index: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: index)]
}
}
extension String {
public func levenshtein(_ other: String) -> Int {
@simonbromberg
simonbromberg / ListFonts.m
Last active September 6, 2023 03:35
List all fonts available on iOS device in console
// List all fonts on iPhone
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
for (NSString *family in familyNames) {
NSLog(@"Family name: %@", family);
fontNames = [UIFont fontNamesForFamilyName: family];
for (NSString *font in fontNames) {
NSLog(@" Font name: %@", font);
}