Skip to content

Instantly share code, notes, and snippets.

View nowsprinting's full-sized avatar
🏠
Working from home

Koji Hasegawa nowsprinting

🏠
Working from home
View GitHub Profile
@nowsprinting
nowsprinting / AnalyzerImporter.cs
Created October 31, 2021 02:12
This script applies the Roslyn analyzers under the assembly definition file (.asmdef) to each project .csproj file. Analyzer maintains the dependencies described in the <see href="https://docs.unity3d.com/2020.2/Documentation/Manual/roslyn-analyzers.html">Analyzer scope</see> of Unity 2020.2 or later. You can distribute the analyzer for your lib…
// Copyright (c) 2021 Koji Hasegawa
// This software is released under the MIT License.
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using UnityEditor;
set appName to "JetBrains Rider" -- "JetBrains Rider-EAP" when using EAP
-- Full Wide VGA
set width to "854"
set height to "480"
tell application "System Events"
tell process appName
set size of front window to {width, height}
end tell
set appName to "Unity"
-- Full Wide VGA
set width to "854"
set height to "480"
tell application "System Events"
tell process appName
set size of front window to {width, height}
end tell
@nowsprinting
nowsprinting / create_xxxhdpi_images_from_xhdpi.py
Last active August 29, 2015 14:06
drawable-xhdpiディレクトリにある画像ファイルを元に、(縦横二倍して)drawable-xxxhdpiを生成する
#!/usr/bin/env python2.7
#coding=utf-8
"""
指定ディレクトリ下のdrawable-xhdpiディレクトリにある画像ファイルを元に、(縦横二倍して)drawable-xxxhdpiディレクトリ下に画像ファイルを生成します。
主にAndroid用。
Usage
$ create_xxxhdpi_images_from_xhdpi.py -r <RESOURCE_DIR>
before
@nowsprinting
nowsprinting / FxRateLoaderTest.java
Created December 13, 2013 06:22
@it掲載「Android Mockを利用してHTTP通信をテストするには」サンプルコードのEasyMock使用版 - 記事: http://www.atmarkit.co.jp/ait/articles/1204/13/news144.html - テスト対象: https://atec.googlecode.com/svn/atmarkit/usemock/trunk/UseMockExample
/*
* Copyright(c) 2012-2013 Android Test and Evaluation Club.
*
*/
package org.android_tec.atmarkit.usemockexample.models;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@nowsprinting
nowsprinting / FxRateLoaderTest.java
Created November 30, 2012 23:34
@it掲載「Android Mockを利用してHTTP通信をテストするには」サンプルコードのmockito使用版
/*
* Copyright(c) 2012 Android Test and Evaluation Club.
*
*/
package org.android_tec.atmarkit.usemockexample.models;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@nowsprinting
nowsprinting / gist:4131415
Created November 22, 2012 14:22
UI Automatorさんがtwiccaで投稿してくれるテスト
package com.nowsprinting.uiautomatorexample;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
/**
* UI Automatorでtwiccaを操作してみるテスト.
*
@nowsprinting
nowsprinting / AboutViewController.m
Created November 12, 2011 02:10
ビルドを実行した年をcopyright表記に埋め込む for Objective-C/iOS project
//ビルド年を求める
char* date = __DATE__;
char* year = date + strlen(date) -4;
NSInteger buildYear = atoi(year);
//Copyrightの設定
if(COPYRIGHT_FIRSTVERSION_YEAR==buildYear){
copyright_.text = [NSString stringWithFormat:@"%@ %d %@",
COPYRIGHT_PREFIX, COPYRIGHT_FIRSTVERSION_YEAR, COPYRIGHT_SUFFIX];
}else{
@nowsprinting
nowsprinting / prefix.pch
Created November 12, 2011 02:03
prefix.pch (includes logging macro) for iOS project
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@nowsprinting
nowsprinting / codetemplates.xml
Created November 7, 2011 21:29
Eclipse code template for Java/Android project
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/** @return the {@link #${bare_field_name}}. */</template><template autoinsert="false" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/** @param ${param} the {@link #${bare_field_name}} to set. */</template><template autoinsert="false" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/**
* Constructs a new ${enclosing_type} with the ...
*
* ${tags}
*/</template><template autoinsert="false" context="filecomment_context" deleted="false" description="Comme