Skip to content

Instantly share code, notes, and snippets.

Avatar
🐆

a.yasui a-yasui

🐆
View GitHub Profile
@a-yasui
a-yasui / www.conf
Last active Jan 2, 2019
I use the word press at nginx + php-fpm
View www.conf
#
# Directory List:
#
# /srv/www <- base
# /srv/www/webpage <- root directory
# /srv/www/pages/40x.html <- 40x error page
# /srv/www/pages/50x.html <- 50x server error page
#
server {
@a-yasui
a-yasui / installer.sh
Last active Dec 31, 2018
install PHPEnv + PHP7.2 + MySQL8 in CentOS7
View installer.sh
#!/usr/bin/env bash
# see: https://qiita.com/a_yasui/items/40ec1c30afc9f90acd0e
PHP_VERSION=7.2.13
INSTALL_DIR=/opt/phpenv
MYSQL_YUM_REPOSITORY_RPM=https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
MY_CNF=https://gist.githubusercontent.com/a-yasui/9b3a185f2920e5f1bfd0dbba10aa2261/raw/6a5ec116dc6295aeeda1ca3599fe11da687e1bb3/my.cnf
# 必要なものをインストール
@a-yasui
a-yasui / convert.php
Created Aug 30, 2017
Video IndexerのJSONファイルをWebVTTに書き出すスクリプト
View convert.php
<?php
/**
* php ./convert.php -f <json file>
*/
/**
* Class Block
*/
class Block
{
/**
@a-yasui
a-yasui / test.swift
Created Dec 21, 2016
リンク入りテキストを全部オレンジ色にしたいだけのコード。期待通り動かない泣きたい
View test.swift
class ViewController: NSViewController
{
func load(){
let attributeText = NSMutableAttributedString(string: "テスト")
let field = NSTextField(frame: NSRect(x: 0, y: 0, width: 30, height: 30))
let attr = [
NSLinkAttributeName: "https://google.com/",
] as [String : Any]
@a-yasui
a-yasui / log.py
Created Oct 18, 2016
logger の設定テンプレ
View log.py
#!/usr/bin/env python
import logging
from logging import getLogger, StreamHandler, DEBUG
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s (%(threadName)-10s) %(levelname)s %(message)s")
logger = getLogger(__name__)
handler = StreamHandler()
@a-yasui
a-yasui / gist:7940da69a17ce385a43a4cd0a1d26846
Created Oct 17, 2016
psコマンドで表示されるメモリー容量を、MB単位で表示
View gist:7940da69a17ce385a43a4cd0a1d26846
#!/bin/sh
ps uax | awk 'BEGIN{FS=" ";OFS="\t";}{print $1,$2,$3,$4,$5,$6/1024 " MB",$7,$8,$9,$10,$11;}'
@a-yasui
a-yasui / httpd.conf
Last active Dec 28, 2015
MAMP.cwd の brew apache2 バージョン
View httpd.conf
# /usr/local/Cellar/etc/apache2/httpd.conf
ServerRoot "/usr/local/Cellar/httpd/2.2.25"
Listen 8888
LoadModule authn_file_module libexec/mod_authn_file.so
LoadModule authn_dbm_module libexec/mod_authn_dbm.so
LoadModule authn_anon_module libexec/mod_authn_anon.so
LoadModule authn_dbd_module libexec/mod_authn_dbd.so
LoadModule authn_default_module libexec/mod_authn_default.so
LoadModule authz_host_module libexec/mod_authz_host.so
LoadModule authz_groupfile_module libexec/mod_authz_groupfile.so
@a-yasui
a-yasui / PHP53.log
Created Oct 17, 2013
PHP5.5/PHP5.3 にて、連想配列とSwitchのパフォーマンス比較。結果的にはswitchの方が速く、PHP55の方が速いですよっと。
View PHP53.log
$ /usr/local/Cellar/php53/5.3.27/bin/php switch_or_array.php
start arr ... Finish: 10.038110971451
start sw ... Finish: 6.0564711093903
@a-yasui
a-yasui / loop_reader.php
Last active Dec 19, 2015
AMQP/RabbitMQ めも
View loop_reader.php
<?php
/** 兎に角ループさせる */
while (true) {
echo " [x] If you wanna stop, you push Ctrl-C","\n";
require("reader.php");
sleep(1);
}
@a-yasui
a-yasui / .tmux.conf
Created Jun 25, 2013
僕の .tmux.conf
View .tmux.conf
set-option default-shell /bin/zsh
# Prefix
set-option -g prefix C-z
# 日本語環境なら必須??
setw -g utf8 on
set -g status-utf8 on
# status