Skip to content

Instantly share code, notes, and snippets.

View fromkk's full-sized avatar

Kazuya Ueoka fromkk

View GitHub Profile
@fromkk
fromkk / highlight.js
Created February 1, 2024 06:59
Generate highlight movie with Transcoder API
const projectId = "your-project-id";
const location = "asia-east1";
const {TranscoderServiceClient} = require("@google-cloud/video-transcoder").v1;
const client = new TranscoderServiceClient();
/**
* calcOffsetNanoSec
* @param {number} offsetValueFractionalSecs input
* @return {number}
#!/bin/sh
CURRENT_DIR=$(pwd)
sh ${CURRENT_DIR}/SwiftFormat.sh
#!/bin/sh
git diff --name-only --diff-filter=d --cached "*.swift" | xargs -I {} swiftformat {}
git diff --name-only --diff-filter=d --cached | xargs -I {} git add {}
@fromkk
fromkk / dsym_upload.sh
Last active January 4, 2023 00:53
upload dSYM files without CocoaPods
#!/bin/sh
function help() {
cat <<EOF
$(basename ${0}) is a tool for upload dsyms for Firebase Crashlytics
Usage:
$(basename ${0}) [dsyms/ path] [Google-Service.plist path]
e.g.
$(basename ${0}) "/path/to/dsyms" "/Path/To/GoogleService_info.plist"
EOF
import Foundation
import StoreKit
// helper
struct IAPHelper {
static var canMakePayments: Bool {
SKPaymentQueue.canMakePayments()
}
static func formattedPrice(with product: SKProduct) -> String? {
@fromkk
fromkk / calendar_summary.gs
Created February 25, 2021 02:59
当日のカレンダーをサマリをメールで送信する
function main() {
const calendarId = "YOUR_GMAIL_ADDRESS";
const calendar = CalendarApp.getCalendarById(calendarId);
const now = new Date();
const weekday = now.getDay();
const events = calendar.getEventsForDay(now);
var horidayCalendar = CalendarApp.getCalendarById('ja.japanese#holiday@group.v.calendar.google.com');
if (horidayCalendar.getEventsForDay(now, {max: 1}).length > 0) {
return;
@fromkk
fromkk / SMS_CODE.gs
Created February 13, 2021 11:06
SMSのコードを返すGAS
function doGet() {
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const sheet = spreadsheet.getActiveSheet();
const range = sheet.getRange("A2");
const value = ('000000' + range.getValue()).slice(-6);
const out = ContentService.createTextOutput();
out.setMimeType(ContentService.MimeType.JSON);
out.setContent(JSON.stringify({"code": value}));
return out;
}
@fromkk
fromkk / bitrise.yml
Created February 13, 2021 08:52
DSYMsのダウンロード・アップロードに対応したbitrise.yml
---
format_version: '6'
default_step_lib_source: 'https://github.com/bitrise-io/bitrise-steplib.git'
project_type: fastlane
app:
envs:
- BITRISE_PROJECT_PATH: App.xcodeproj
- BITRISE_SCHEME: App
- BITRISE_EXPORT_METHOD: development
workflows:
@fromkk
fromkk / Fastfile.rb
Last active February 13, 2021 08:46
DSYMsのダウンロード・アップロードに対応したFastfile
require "net/http"
require "uri"
require "pty"
require "expect"
require "fastlane"
require "spaceship"
require "json"
require 'zip'
fastlane_version "2.174.0"
import UIKit
import PlaygroundSupport
protocol WaterfallLayoutDelegate: AnyObject {
    func numberOfColumns() -> Int
    func columnsSize(at indexPath: IndexPath) -> CGSize
    func columnSpace() -> CGFloat
}
final class WaterfallLayoutViewController: UIViewController, UICollectionViewDataSource {