This file contains hidden or 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
#!/bin/sh | |
echo "--------------------------------------------------" | |
date +"%Y/%m/%d %H:%M:%S" | |
echo "--------------------------------------------------" | |
vendor/bin/phpunit -c phpunit.xml.dist |
This file contains hidden or 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
#!/bin/sh | |
#watchmedo shell-command -w --recursive --patterns "*.php" --ignore-directories --ignore-pattern '*/.*' --command 'echo "${watch_event_type} | ${watch_object} | ${watch_src_path}"' ./ | |
watchmedo shell-command -w --recursive --patterns "*.php" --ignore-directories --command 'sh test.sh' ./ |
This file contains hidden or 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
{ | |
"require-dev": { | |
"phpunit/phpunit": "^9.0" | |
}, | |
"autoload-dev": { | |
"psr-4": { | |
"Tests\\": "tests/" | |
} | |
} | |
} |
This file contains hidden or 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
<?php | |
use PHPUnit\Framework\TestCase; | |
class aTest extends TestCase | |
{ | |
private $tempDir; | |
protected function setUp(): void | |
{ | |
// ... |
This file contains hidden or 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
<?php | |
# ref: http://hyuki.com/dp/dpinfo.html#BeforeAfter | |
abstract class Executor { | |
abstract protected function before(); | |
abstract protected function execute(); | |
abstract protected function after(); | |
public function perform () { | |
$this->before(); | |
try { | |
$this->execute(); |
This file contains hidden or 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; | |
public class DebugGizmos : MonoBehaviour { | |
void OnDrawGizmos() { | |
float halfWidth = GetComponent<SpriteRenderer>().bounds.extents.x; | |
float halfHeight = GetComponent<SpriteRenderer>().bounds.extents.y; | |
CapsuleCollider2D capsuleCollider2D = GetComponent<CapsuleCollider2D>(); |
This file contains hidden or 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; | |
public class Floating : MonoBehaviour | |
{ | |
protected Rigidbody2D rbody; | |
void Start() | |
{ | |
this.rbody = GetComponent<Rigidbody2D>(); | |
this.rbody.mass = 20; |
This file contains hidden or 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 Start() { | |
if (Camera.main != null) { | |
Camera.main.orthographicSize = ORTHOGRAPHIC_SIZE; | |
} | |
if (FindObjectOfType<EventSystem>() == null) { | |
var eventSystem = new GameObject("EventSystem", typeof(EventSystem)); | |
eventSystem.AddComponent<StandaloneInputModule>(); | |
} | |
This file contains hidden or 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
<?php | |
var_dump(preg_replace('/[^0-9]/', '', hash('sha256','test'))); | |
?> |
This file contains hidden or 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
#!/bin/sh | |
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -L1 -I@ sh -c 'j=@; echo "${j}"; sh -c "ls -lt /jail/${j}/" | grep "tmp"; echo;' |