Skip to content

Instantly share code, notes, and snippets.

@nooptr
nooptr / docker-log.sh
Created October 8, 2015 02:26 — forked from yarcowang/docker-log.sh
simple bash script to show log for a docker image
#!/usr/bin/env bash
DOCKER=`which docker`
usage()
{
echo "Usage: $(basename $0) [-l num] IMAGE"
exit 0
}
@nooptr
nooptr / file0.txt
Last active January 7, 2016 02:19
GCPの他のプロジェクトからイメージを使う方法 ref: http://qiita.com/thangnv/items/da4e719efd83471a3ca8
gcloud config set project <project-id-of-project-2>
gcloud config list
@nooptr
nooptr / gist:794c5e1644ace81aea77
Created January 29, 2016 03:53 — forked from takatoshiono/gist:41bfc4ec52c3a89da2eb
オンラインDDLの実験用データ
DROP TABLE products;
CREATE TABLE products(
id int not null auto_increment,
name varchar(255),
stocks int,
created_at datetime,
updated_at datetime,
primary key (id)
) ENGINE=InnoDB;
<?php
phpinfo();
@nooptr
nooptr / readable_code.md
Created November 16, 2016 03:22 — forked from AKB428/readable_code.md
リーダブルコード要約/Digest 「The Art of Readable Code」

リーダブルコード読書会及び要約共有会の目的

  • 今後コードレビュー時に「これってリーダブルコードの◯◯だよね?、こう直したほうがいいよね」と引用できレビューの時間の短縮化が実現できる。
  • リーダブルコードに登場する特殊ワードをチームのコーディングの共通語とする。デザインパターンのカタログ的な考え。
  • リーダブルコードを読んでない人も内容を短時間で把握できる。
  • チーム全体のコードを読みやすくメンテナンスしやすくし品質をあげる。
  • リーダブルコード教になりチーム以外にも広める。コードの品質が悪い人にはリーダブルコードの読書を進めてみる。ひどいコードのままコーディングしてもらうよりその時間を読書の時間に割り当てることも考える(結果的に時間が還元できるなら)。
  • リーダブルコードに書いてあることが全てのプロジェクトに適用てきるわけではないけれでもコーディングルールを考える際の指針にすることはできる。

対象者

@nooptr
nooptr / README.md
Created February 22, 2017 13:23 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications you can follow me @leonardofed


<?php
$users = array(10, 100, 1000, 10000, 100000);
$request_number = 24*60*60/5; // polling = 5s
foreach ($users as $user) {
$requests = $request_number * $user;
$computings = ($request_number * 2 * 256 / 1024) * $user;
@nooptr
nooptr / read_post_line_app.php
Last active May 8, 2018 00:46
Read request body sent from LINE App
<?php
$raw = file_get_contents('php://input');
file_put_contents('/tmp/log_line_' . date('YYmmdd'), $raw . PHP_EOL, FILE_APPEND);
// ログ確認方法
// https://example.com?log=1
$log = filter_input(INPUT_GET, 'log', FILTER_SANITIZE_URL);
if ($log) {
$handle = popen("tail -f /tmp/log_line_" . date("YYmmdd") . " 2>&1", 'r');
while(!feof($handle)) {
<?php
$ch = curl_init(URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// プロキシを無効に設定
curl_setopt($ch, CURLOPT_PROXY, "");
#!/usr/bin/env bash
# Usage:
# ./solc [options] inputfile > outfile
# Notes:
# - file i/o is limited to the current directory
# - this works with the pyethereum solc_wrapper
docker run -i --rm --user $(id -u):$(id -g) -v $(pwd):/tmp --workdir /tmp ethereum/solc:0.4.24 $@