Skip to content

Instantly share code, notes, and snippets.

View akiya64's full-sized avatar
🏠
Working from home

Akiya akiya64

🏠
Working from home
View GitHub Profile
@akiya64
akiya64 / pre-commit
Created November 6, 2017 00:52
Auto fix php/css codingstyle for WordPressCoding by git-hooks
#!/bin/sh
# phpcs bin path
PHPCS_DIR=./phpcs/bin
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
@akiya64
akiya64 / gist:7618698356a7938daefa1843608e8868
Created November 5, 2017 03:56
Auto fix php/css codingstyle for WordPressCoding at pre-commit
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Redirect output to stderr.
@akiya64
akiya64 / init.vim
Last active October 8, 2017 05:51
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~\.cache\dein\repos\github.com\Shougo\dein.vim
" Required:
if dein#load_state('~\.cache\dein')
@akiya64
akiya64 / .vimrc
Created September 29, 2017 08:11
.vimrc
filetype off
"backup保存先
set backupdir=~/.vim/tmp
"backup保存先
set undodir=~/.vim/tmp
if has('win64')
set runtimepath^=~/.vim/
@akiya64
akiya64 / automatic-deploy.uml
Last active June 18, 2017 11:01
Automatic WordPressTheme Deployment Sequence
@startuml
skinparam BoxPadding 10
Local -> Master :Push
box "GitHub" #gainsboro
participant Master
participant Release
end box
Box "TravisCI" #khaki
@akiya64
akiya64 / count-line.ps1
Created March 30, 2017 08:13
Count Lines in Folder
Get-ChildItem -Recurse | Where-Object {($_.name -like "*cls") -or ($_.name -like "*bas") -or ($_.name -like "*dcm")} | ForEach-Object { Get-Content $_.Name } | Measure-object
@akiya64
akiya64 / .gitignore
Last active March 25, 2017 05:48
Redmine on Heroku
/.project
/.loadpath
/.powrc
/.rvmrc
/config/additional_environment.rb
/coverage
/db/*.db
/db/*.sqlite3
/db/schema.rb
/files/*
@akiya64
akiya64 / functions.part.php
Created February 6, 2017 04:21
Switch Excerpt
add_action ( 'edit_category_form_fields', 'extra_category_fields');
function extra_category_fields( $tag ) {
$tid = $tag->term_id;
$is_show_excerpt = get_option( "cat_$tid_show_excerpt");
?>
<tr class="form-field">
<th><label for="extra_text">抜粋を表示</label></th>
<td>
<select name="is_show_exception" id="is_show_exception">
<?php if($is_show_excerpt): ?>
@akiya64
akiya64 / echoAlmostAllTags
Last active December 26, 2016 08:50
How include html tags into php code?
///////////////////////////////////////////////////////////////upper layout part
echo("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
echo("<html xmlns='http://www.w3.org/1999/xhtml'>");
echo("<head>");
echo("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />");
echo("<meta http-equiv='content-language' content='en' />");
echo("<meta http-equiv='imagetoolbar' content='no' />");
echo("<link rel='stylesheet' href='".$abs_pass."style.css' type='text/css' /> ");
echo("<title>".$abs_title."</title>");
@akiya64
akiya64 / StringOrLong
Created December 15, 2016 07:48
Can I Roundup String?
Dim finalNumber As String
finalNumber = 50000001
Dim newStartNumber As String
newStartNumber = Application.RoundUp(finalNumber, -1)
Dim newFinalNumber As String
For i = 2 To ThisWorkbook.Worksheets(db).Range("B50000").End(xlUp).Row
With ThisWorkbook.Worksheets(db)