This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud logging read --order=asc --format=json ' | |
timestamp>="2019-06-13T12:20:00+09:00" AND timestamp<="2019-06-13T15:00:00+09:00" | |
AND resource.type="container" | |
AND logName="projects" | |
AND severity>=ERROR | |
AND sample(insertId, 0.001) | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# プロジェクトのリストを表示 | |
$ gcloud projects list | |
# プロジェクトの切り替え | |
$ gcloud config set project PROJECT_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ aws ec2 describe-instances --query 'Reservations[*].Instances[*].PublicDnsName' --output text | |
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com | |
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com | |
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com | |
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections; | |
public class UUIDManager : SingletonMonoBehaviour<UUIDManager> { | |
Guid guid; | |
[SerializeField] | |
string _uuid = ""; | |
public string uuid { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// MonoBehaviourを継承したシングルトン | |
/// </summary> | |
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : MonoBehaviour { | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CheckExitScreen(){ | |
if (Mathf.Abs(_Rigidbody.position.x) > Camera.main.orthographicSize * Camera.main.aspect) { | |
_Rigidbody.position = new Vector3(-Mathf.Sign(_Rigidbody.position.x) * Camera.main.orthographicSize * Camera.main.aspect, 0, _Rigidbody.position.z); | |
_Rigidbody.position -= _Rigidbody.position.normalized * 0.1f; // 反対側に移動 | |
} | |
if (Mathf.Abs(_Rigidbody.position.z) > Camera.main.orthographicSize) { | |
_Rigidbody.position = new Vector3(_Rigidbody.position.x , _Rigidbody.position.y, -Mathf.Sign(_Rigidbody.position.z) * Camera.main.orthographicSize); | |
_Rigidbody.position -= _Rigidbody.position.normalized * 0.1f; // 反対側に移動 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.EventSystems; | |
using UnityStandardAssets.CrossPlatformInput; | |
using UnityEngine.UI; | |
public class PlayerJoystick : Joystick, InputGesture { | |
Image joystickImage; | |
EventSystem es; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float mean(vector<float> v) { | |
int size = v.size(); | |
float sum = 0; | |
for (int i = 0; i < size; i++){ | |
sum += v[i]; | |
} | |
return sum / size; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class CameraControl : MonoBehaviour { | |
private GameObject player = null; | |
private Vector3 offset = Vector3.zero; | |
void Start () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Clamp() { | |
Vector3 posZToY = position; | |
posZToY.y = position.z; | |
Vector3 posInScreen = Camera.main.WorldToViewportPoint(posZToY); | |
Vector3 pos = position; | |
posInScreen.x = Mathf.Clamp (posInScreen.x, 0, 1); | |
posInScreen.y = Mathf.Clamp (posInScreen.y, 0, 1); | |
Vector3 _pos = Camera.main.ViewportToWorldPoint(posInScreen); | |
pos.x = _pos.x; | |
pos.z = _pos.y; |
NewerOlder