Skip to content

Instantly share code, notes, and snippets.

View anzfactory's full-sized avatar
:octocat:
Working from home

anz anzfactory

:octocat:
Working from home
View GitHub Profile
@anzfactory
anzfactory / Vector3Extension.cs
Last active August 17, 2022 15:48
[Unity]ワールド座標をスクリーン座標へ変換するクラス拡張
/*********************************
2015-06-20
Vector3拡張
座標変換参考:http://tsubakit1.hateblo.jp/entry/2016/03/01/020510
*********************************/
using UnityEngine;
using UnityEngine.Assertions;
public static class Vector3Extension
{
@anzfactory
anzfactory / swiftgen_template.stencil
Created April 30, 2021 10:49
テストケースを自動生成させるためのテンプレート
//
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
//
{% macro allValuesBlock assets prefix %}
{% for asset in assets %}
{% if asset.items %}
{% set newPrefix %}{{prefix}}{{asset.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}.{% endset %}
{% call allValuesBlock asset.items newPrefix %}
{% elif asset.type != "group" %}
_ = Asset.{{prefix}}{{asset.name|swiftIdentifier:"pretty"|lowerFirstWord}}.{{asset.type}}
@anzfactory
anzfactory / SourceEditorCommand.swift
Last active January 22, 2021 14:07
DeepLを開くXcode Source Editor Extension
import AppKit
import Foundation
import XcodeKit
final class SourceEditorCommand: NSObject, XCSourceEditorCommand {
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
defer {
completionHandler(nil)
@anzfactory
anzfactory / main.dart
Created November 15, 2020 03:51
特定の画像表示でクラッシュする 🤔
/*
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.51.1)
[✓] Connected device (1 available)
*/
@anzfactory
anzfactory / publish.yml
Last active September 27, 2020 12:16
Swift製の静的サイトジェネレーター「Publish」でビルドしつつ、Firebase HostingにデプロイするGitHub Actionsのワークフロー
name: Publish
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
@anzfactory
anzfactory / DeleteApp.swift
Last active April 1, 2020 05:16
XCUITestでアプリ削除するやつ
func deleteApp() {
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
springboard.activate()
let appName = "MyApp"
// ホームから該当アプリ探す
let appIcon = springboard.icons[appName]
guard appIcon.exists else {
return
@anzfactory
anzfactory / custom_bance_area_example.dart
Last active February 11, 2020 06:40
バウンスエリアの背景色を変えたい
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ListPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('バウンスエリア色変えたいんじゃ'), elevation: 0.0,),
body: _Page(),
@anzfactory
anzfactory / sync_bitrise.yml.sh
Created December 3, 2019 13:14
bitrise.ymlをダウンロードしてきて差異があればPRをつくるやつ。Scriptステップでつかえる。
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# download bitrise.yml
curl -O -H "Authorization: token ${BITRISE_API_ACCESS_TOKEN}" "https://api.bitrise.io/v0.1/apps/${BITRISE_APP_SLUG}/bitrise.yml"
# check diff
@anzfactory
anzfactory / Talk.cs
Last active November 23, 2019 12:35
会話イベントをタイムライン風に表示するやーつ http://anz-note.tumblr.com/post/145359548501
/*********************************
* 会話イベントをタイムライン風に表示するやーつ
* 参考:http://tsubakit1.hateblo.jp/entry/2015/10/19/022720
*********************************/
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Talk : MonoBehaviour