Skip to content

Instantly share code, notes, and snippets.

@shimabox
shimabox / Sample_PhpDocumentor_Hoge.php
Last active August 17, 2022 00:54
phpDocumentorのちょっとしたサンプル
<?php
/**
* PHPDocumentorのちょっとしたサンプル
* @author shimabox
*/
/**
* require
*/
require_once './Interfaces/IHoge.php';
@shimabox
shimabox / blink_game2.py
Created September 15, 2018 08:14
目をつぶったら画面キャプチャを終了するやつ(Python+OpenCV)の改善
@shimabox
shimabox / face_and_eye_recognition.py
Last active October 19, 2021 02:39
WEBカメラの映像から顔と目を検出して目にはモザイクをかけるやつ(Python+OpenCV)
import sys
import cv2 # OpenCV のインポート
'''
参考
@link http://ensekitt.hatenablog.com/entry/2017/12/19/200000
@link https://note.nkmk.me/python-opencv-face-detection-haar-cascade/
@link https://note.nkmk.me/python-opencv-mosaic/
@link http://workpiles.com/2015/04/opencv-detectmultiscale-scalefactor/
'''
<!DOCTYPE html>
<html>
<head>
<title>transform: scaleX(-1) されている要素のx座標を求める</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
body {
background: #b1acacb3;
}
<?php
namespace Sample2;
/**
* 当クラスでは更新命令を監視し(実際には教えてもらうが)
*
* - 最初の命令から閾値(マイクロ秒)以下で処理が実行されている場合、
* 閾値 - 前回の処理から今回の処理までの実行間隔 の値で usleep を挟む
*
<?php
namespace Sample1;
/**
* 当クラスでは更新命令数を監視し(実際には教えてもらうが)
*
* - 最初の命令から閾値となる秒数が過ぎていない
* - かつ、監視していた実行数が許可された実行数を超えていたら
* 閾値 - 最初の計測から今回の処理までの実行間隔 の値で usleep
@shimabox
shimabox / blink_game.py
Created August 28, 2018 21:56
目をつぶったら画面キャプチャを終了するやつ(Python+OpenCV)
@shimabox
shimabox / PHPUnitとPHPのバージョン対応表.md
Last active August 17, 2017 22:41
PHPUnitとPHPのバージョン対応表
@shimabox
shimabox / getUrlStatus.php
Last active August 7, 2017 22:30
URLを渡すとヘッダー情報を見てステータスを返す
<?php
/**
* URLのステータスを返す
*
* <code>
* $ret = getUrlStatus($url);
*
* $ret->url; // string URL<br>
* $ret->reachedUrl; // string 最後に到達したURL<br>
* $ret->isValid; // bool 有効なURLか<br>
@shimabox
shimabox / phpunit_ajax_sample.php
Last active June 22, 2017 05:44
jsonを返すAPIのテストコード
<?php
/**
* メッセージ(json)を返すAPIと仮定
*
* あくまでもサンプルなので例外処理は入れていません
*/
class Sample
{
/**
* @var array