Skip to content

Instantly share code, notes, and snippets.

View k4zuki02h4t4's full-sized avatar
🏠
家で働く

KAZUKI Otsuhata k4zuki02h4t4

🏠
家で働く
View GitHub Profile
@k4zuki02h4t4
k4zuki02h4t4 / .txt
Created April 26, 2017 15:40
日数 = 秒
365日 = 31536000
182.5日 = 15768000
180日 = 15552000
90日 = 7776000
30日 = 2592000
15日 = 1296000
7日 = 604800
1日 = 86400
12時間 = 43200
6時間 = 21600
@k4zuki02h4t4
k4zuki02h4t4 / .md
Last active June 5, 2019 23:42
よく使う便利コメンド

gzip で圧縮する

$ tar -C /path/to/dir -zcvf archive.tar.gz ./

gzip を解凍する

$ tar -C /path/to/dir -zxvf archive.tar.gz
@k4zuki02h4t4
k4zuki02h4t4 / yt-chat-overlay.css
Created April 8, 2017 15:04
OBS(https://obsproject.com) で YouTube Live のチャットをオーバーレイする時に使用する CSS。
@import url("https://fonts.googleapis.com/css?family=Noto Sans");
/* Background colors*/
body {
background-color: rgba(0,0,0,0);
line-height: 1.5 !important;
}
/* Transparent background. */
yt-live-chat-renderer {
@font-face {
font-family: "VisuAliveYuGothicM";
font-weight: normal;
src: local("YuGothic-Medium"),
local("Yu Gothic Medium"),
local("YuGothic-Regular");
}
@font-face {
font-family: 'VisuAliveYuGothicM';
font-weight: bold;
<?php
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->XMailer = ' VisuAlive Mail Form';
} );
@k4zuki02h4t4
k4zuki02h4t4 / .php
Last active October 15, 2016 08:46
WordPressのbody_class()関数とcomment_class()関数からログインIDを削除する。
<?php
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
*
* @return array
* @copyright KUCKLU & VisuAlive
*/
function themeslug_body_class( $classes ) {
@k4zuki02h4t4
k4zuki02h4t4 / functions.php
Created September 13, 2016 13:23
[WordPress] Shortcode - Post list.
<?php
/**
* Shortcode - Post list.
*
* @param array $atts The Shortcode arguments.
*
* @return string
*/
function kuck1u_shortcode_postlist( $atts ) {
$atts = shortcode_atts( array(
@k4zuki02h4t4
k4zuki02h4t4 / gist:028d234b3609a158d167738fde3acc86
Created September 8, 2016 05:49
否定系の正規表現
/^(?!.*(wp\-admin|wp\-login)).+$/
/^((?!(wp\-admin|wp\-login)).)*$/
@k4zuki02h4t4
k4zuki02h4t4 / http2-server-push.rb
Created September 8, 2016 05:11 — forked from tomfuertes/http2-server-push.rb
Rails HTTP2 Server Push via Header Link (on Cloudflare)
class ApplicationController < ActionController::Base
after_action :server_push_headers # https://twitter.com/connorjshea/status/728472354385317888
def server_push_headers
# CLoudflare HTTP2 Server Push: https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
if request.format.html? # only on html pages
layout = self.send(:_layout) # with the right layout
if layout == "main" || layout == "speaker" || layout == "admin"
assets = [
@k4zuki02h4t4
k4zuki02h4t4 / access-restriction.rb
Last active September 22, 2016 05:24
Access restriction & Server push by mruby for H2O HTTP/2 server.
class H2oServerHeader
def call(env)
path = env["PATH_INFO"]
method = env['REQUEST_METHOD']
exclude = [
"/php.ini",
"/readme.html",
"/readme-ja.html",
"/wp-config.php",
"/wp-config-sample.php",