Skip to content

Instantly share code, notes, and snippets.

View cafedeichi's full-sized avatar
🇺🇦

Ichiro Hirata cafedeichi

🇺🇦
View GitHub Profile
@cafedeichi
cafedeichi / settings.yml
Last active January 10, 2024 04:54
github-nippou settings
format:
subject: '## %{subject}'
line: '* [%{title}](%{url}) %{status} %{user} '
dictionary:
status:
merged: '**merged!**'
closed: '**closed!**'
@cafedeichi
cafedeichi / settings.yml
Last active April 1, 2021 14:01
github-nippou settings
format:
subject: '### %{subject}'
line: '- [%{title}](%{url}) %{status}'
dictionary:
status:
merged: '**merged**'
closed: '**closed**'
const core = require('@actions/core');
const Nightmare = require('nightmare');
const Path = require('path');
const cheerio = require('cheerio');
const fs = require('fs');
const nightmare = Nightmare({ show: false });
const url = 'https://developer.apple.com/app-store/review/guidelines';
const filePath = 'html/guidelines.html';
@cafedeichi
cafedeichi / deploygate_direct_url.sh
Created March 1, 2020 04:36
How to comment DeployGate links for each build version on GitHub pull request via Bitrise
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
if ! which brew >/dev/null; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
@cafedeichi
cafedeichi / AppStoreReviewGuidelinesHistory_main.yml
Last active June 15, 2020 03:26
How I made GitHub Actions beneficial as iOS Engineer (aside from Xcode)
name: App Store Review Guidelines History
on:
schedule:
- cron: '0 8,20 * * *'
jobs:
build:
runs-on: macOS-latest
steps:
- name: Git check-out
uses: actions/checkout@master
@cafedeichi
cafedeichi / EditViewController.swift
Created January 25, 2020 05:17
The lifecycle and control when dismissing a modal view with ".pageSheet" in iOS 13
// 1: Return a boolean value if text has changed.
var hasChanges: Bool {
return originalText != editedText
}
override func viewWillLayoutSubviews() {
textView.text = editedText
// 2: Set the hasChanges property to isModalInPresentation
let hasChanges = self.hasChanges
@cafedeichi
cafedeichi / pattern_1_2.swift
Created January 24, 2020 04:44
The lifecycle and control when dismissing a modal view with ".pageSheet" in iOS 13
isModalInPresentation = true
func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) {
// Call dismiss
dismiss(animated: true)
// By following the parent ViewController delegate methods,
// you can reload the tableview, pass values and so on.
self.delegate?.editViewControllerDidFinish(self)
}
@cafedeichi
cafedeichi / pattern_1_1.swift
Last active January 18, 2020 09:48
The lifecycle and control when dismissing a modal view with ".pageSheet" in iOS 13
protocol EditViewControllerDelegate: class {
func editViewControllerDidCancel(_ editViewController: EditViewController)
func editViewControllerDidFinish(_ editViewController: EditViewController)
}
extension EditViewController: UIAdaptivePresentationControllerDelegate {
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
// By following the parent ViewController delegate methods,
// you can reload the tableview, pass values and so on.
self.delegate?.editViewControllerDidFinish(self)
@cafedeichi
cafedeichi / bitrise_script_step.sh
Created December 27, 2019 00:05
How to handle $(MARKETING_VERSION) of Xcode 11 by CI
#!/usr/bin/env bash
# fail if any commands fails
set -e
# get release number from Xcode build settings
version=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' {プロジェクト名}.xcodeproj/project.pbxproj)
if [ -z "${version}" ]; then
echo "[ERROR] failed to get MARKETING_VERSION"
exit 1
@cafedeichi
cafedeichi / market_version.sh
Created December 25, 2019 13:31
How to handle $(MARKETING_VERSION) of Xcode 11 by CI
version=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' {your project name}.xcodeproj/project.pbxproj)a