Skip to content

Instantly share code, notes, and snippets.

View uzulla's full-sized avatar
🚧
WORK,WORK,WORK.

uzulla / Junichi Ishida uzulla

🚧
WORK,WORK,WORK.
View GitHub Profile
@uzulla
uzulla / stop-all-docker-compose.sh
Last active July 21, 2022 07:09
stop running docker-compose containers in anywhere
#!/bin/sh
docker ps --filter 'label=com.docker.compose.project.config_files' --format '{{ .Labels }}' | sed 's/,/\n/g' | grep com.docker.compose.project.config_files | uniq | cut -d = -f 2 | xargs -I {} -L 1 docker-compose -f {} stop
# use jq
# docker ps --format '{{json .Labels}}' | xargs echo | sed "s/,/\n/g" |grep com.docker.compose.project.config_files | cut -d = -f 2|uniq | xargs -I {} -L 1 docker-compose -f {} stop
<?php
// dump list attendees from eventbrite event.
$conf = include("config.php");
// the config php like as
// <?php
//
// return [
// "token"=>"***",
// "event_id"=>"1234567890",
// ];
<?php
function stopwatch($str = null)
{
static $time = null;
if (is_null($str)) {
$time = microtime(true);
} else {
echo $str . ( microtime(true) - $time) . "sec" . PHP_EOL;
$time = 0;
}
@uzulla
uzulla / kakedashi.md
Last active May 8, 2021 07:37
以前しらべた「駆け出しエンジニア」ハッシュタグについての個人的メモ

まえがき

駆け出しエンジニアハッシュタグについて前ちょっと調べたことを残しておく、これは単なる私の調べたメモです。

間違っている、押さえきれていない、見逃している可能性も沢山ありますので、注意してください

調査は

  • twitter検索
  • Google
  • Google Trend
#!/bin/sh
# `convert` command is part of ImageMagick, apt install imagemagick, brew install imagemagick or ....
convert -threshold 30000 src.png tmp.jpg
# ^~~~ bad output? ok, try change here as you like!!!
# Wow, you need negative ? ok.
# convert -negate tmp.jpg tmp2.jpg
# mv tmp2.jpg tmp.jpg
@uzulla
uzulla / sha256_seed_resolver.php
Last active June 4, 2023 00:21
SHA256の逆変換を力技で行う(半分ジョーク)プログラムです。 ( https://github.com/uzulla/sha256-resolver.php にFork版をつくりました)
<?php
// TTILE: SHA256 hash seed resolver (as a joke).
// AUTHOR: uzulla(Junichi ISHIDA) <zishida@gmail.com>
// LICENSE: MIT (https://opensource.org/licenses/MIT)
//
// ## requirement
// php>=7, need GMP extention
//
// ## how to use
// $ php sha256_seed_resolver.php fb8e20fc2e4c3f248c60c39bd652f3c1347298bb977b8b4d5903b85055620603
@uzulla
uzulla / composer.json
Created January 5, 2021 02:15
some amphp bench code
{
"require": {
"amphp/amp": "^2.5",
"amphp/dns": "^1.2",
"amphp/http-client": "^4.5"
}
}
open http://github.com/uzulla/Tinitter/blob/`git branch |cut -f 2 -d ' '`/templates/frame.twig#L10
@uzulla
uzulla / getenv will not work with phpdotenv.md
Last active September 10, 2019 17:01
getenv() will not work with `vlucas/phpdotenv` when set "disable_functions=putenv" at php.ini

getenv() will not work with vlucas/phpdotenv when set "disable_functions=putenv" at php.ini

php.ini

disable_functions=putenv

you could be check by phpinfo()

@uzulla
uzulla / unzip.php
Created September 10, 2019 15:29
uploadしてあるzipをサーバーで解凍
<?php
# uploadしてあるzipをサーバーで解凍
# FTPが重いレンサバなどで、`unzip source.zip`が使えない場合などに使う
# ext-zipが必要
ini_set("max_execution_time", 300);
$zip = new \ZipArchive;
if ($zip->open('source.zip') === true){
$zip->extractTo(__DIR__.'/');
$zip->close();
echo 'success';