Skip to content

Instantly share code, notes, and snippets.

View levantAJ's full-sized avatar
💭
🌵🌵🌵

levantAJ levantAJ

💭
🌵🌵🌵
View GitHub Profile
@levantAJ
levantAJ / ScrollingDecelerator.swift
Last active March 7, 2024 00:42
Transfer the decelerating between multiple UIScrollViews
//
// ScrollingDecelerator.swift
// ShopBack
//
// Created by Tai Le on 6/5/20.
// Copyright © 2020 levantAJ. All rights reserved.
//
final class ScrollingDecelerator {
weak var scrollView: UIScrollView?
@levantAJ
levantAJ / test-coverage-by-feature.sh
Created March 27, 2020 03:11
Generate Test Coverage by Feature (Folder) with Slather
#
# This file to facilitate getting test coverage percentage
#
# How to use:
# 1. For all test cases:
# bash test-coverage.sh
#
# 2. For test cases belong to a feature:
# bash test-coverage.sh {Feature_Folder_Name}
# Feature_Folder_Name: The name of the folder under YourProject.
//
// PhotoPreviewViewController.swift
// ShopBack
//
// Created by Tai Le on 8/31/19.
// Copyright © 2019 levantAJ. All rights reserved.
//
import UIKit
import SDWebImage
@levantAJ
levantAJ / ios-app-icons-resizer.sh
Created November 24, 2019 07:13
iOS app icons resizer script
#!/bin/sh
if [[ $(command -v brew) == "" ]]; then
echo "Installing Hombrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [[ $(command -v magick) == "" ]]; then
echo "Installing magick..."
brew install ImageMagick
@levantAJ
levantAJ / DeepLinkUITests.swift
Created September 21, 2019 09:44
UITest open deep link URLs
//
// XCTestCase+Extension.swift
// UITests
//
// Created by levantAJ on 3/16/19.
// Copyright © 2019 levantAJ. All rights reserved.
//
import XCTest
@levantAJ
levantAJ / use_dylibs.rb
Last active September 12, 2019 09:09
Convert back to use dylib for generate test coverage when using https://gist.github.com/levantAJ/b8eef8121573085d130fde46442e9658
#!/usr/bin/env ruby
def supported_staticlib_pods
return ['YouTubeVideoPlayer']
end
# After we improve Pre-main time app in [improve-pre-main-time-loading.rb](https://gist.github.com/levantAJ/b8eef8121573085d130fde46442e9658)
# Xcode can't generate test coverage with static libs http://www.openradar.me/41024315
# We have to convert back to dylib when running test coverage
# You need to run this before runing unit-test for checking test coverage
@levantAJ
levantAJ / test-coverage.sh
Created August 7, 2019 03:24
Run test coverage for iOS project by using slather
#!/bin/sh
if ! gem spec slather > /dev/null 2>&1; then
echo "Installing slather..."
sudo gem install slather
fi
if [ -e ~/.bashrc ]
then
string=$(<~/.bashrc)
@levantAJ
levantAJ / extract-scheme-url.sh
Created August 7, 2019 03:20
Extract *.ipa file to looking for all scheme URLs
#!/bin/sh
RESET=`tput sgr0`
RED=`tput setaf 1`
GREEN=`tput setaf 2`
if [ "$1" ]; then
if ! [ -e "$1" ]
then
@levantAJ
levantAJ / improve_pre_main_time_loading.rb
Last active November 4, 2021 12:20
⏳Improve the Pre-main time by using `staticlib` for the libraries in CocoaPods
#!/usr/bin/env ruby
def supported_staticlib_pods
return ['YouTubeVideoPlayer']
end
# Improve Pre-main Time
# Using `staticlib`
# Removing the `staticlib` from `[CP] Embed Pods Frameworks`
def improve_pre_main_time_loading(installer, project_name)
//
// ColdStartEventManagerTest.m
// InteractorTest
//
// Created by BBM on 28/3/18.
//
#import "ColdStartEventManager.h"
#import "AhoyReporterProtocol.h"