Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile
@kujiy
kujiy / php-cs-fixer-and-esformatter-pre-commit.php
Last active September 15, 2015 10:12 — forked from mardix/php-cs-fixer-pre-commit.php
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error and make Javascript code beautify with Esformatter
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
* original -> https://gist.github.com/mardix/3623562
*/
/**
* collect all files which have been added, copied or
* modified and store them in an array called output
@kujiy
kujiy / git-hook-add-branch-name-to-commit-msg
Created September 15, 2015 10:15
Git hook / A commit-msg for add branch name to commit message
#!/bin/sh
#ブランチ名を取得
Branch="$(git rev-parse --abbrev-ref HEAD)"
#コミットメッセージの最初にブランチ名を追加
mv $1 $1.tmpbycommit-msg
echo -n "[$Branch] " > $1
cat $1.tmpbycommit-msg >> $1
@kujiy
kujiy / windows-git-init.templatedir-command.bat
Last active March 11, 2021 14:17
git init with templatedir on windows 8.1(64bit)
% git config --global init.templatedir "C:/Users/%username%/.git_template/"
# be careful the things below
-must use " not '
-must use / not \
-needed last / don't omit last /
-don't use baskslash
#-----------------------
✓ okay 1 ✓
#!/bin/bash
echo "---------------------start post-receive : `date`" >> ~/kuji.log
while read oldrev newrev ref
do
branch=`echo $ref | sed 's/refs\/heads\///'`
echo $ref >> ~/kuji.log
done
echo $branch >> ~/kuji.log
@kujiy
kujiy / Terminal.sublime-settings
Last active October 24, 2023 14:18 — forked from branquito/Terminal.sublime-settings
open git bash using `terminal` plugin for sublime
{
// The command to execute for the terminal, leave blank for the OS default
// On OS X the terminal can be set to iTerm.sh to execute iTerm
"terminal": "C:\\Program Files\\Git\\git-bash.exe",
// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["-c", "cd \"%CWD%\" && \"C:\\Program Files\\Git\\bin\\sh.exe\" -i -l"]
@kujiy
kujiy / grunt-exec-php.js
Last active November 16, 2015 02:59
Run your shell command whenever any file is updated.
'use strict';
/**
*
* Make sure you must install modules below before use.
*
* > $ npm i grunt-contrib-watch --save-dev
* > $ npm i grunt-exec --save-dev
*
*
@kujiy
kujiy / git-bash.exe-args
Last active April 20, 2023 13:55
How to open a specific folder with git-bash.exe from a command line(shell)
With argument
"C:\Program Files\Git\git-bash.exe" "--cd=%1"
Direct
"C:\Program Files\Git\git-bash.exe" "--cd="C:\YOUR\FOLDER\"
@kujiy
kujiy / sample.diff
Last active December 9, 2015 05:41 — forked from dasl-/sample.diff
Change to Xoops Smarty Delimiter
diff --git a/Smarty.tmPreferences b/Smarty.tmPreferences
index bf6a0ea..f4117e0 100644
--- a/Smarty.tmPreferences
+++ b/Smarty.tmPreferences
@@ -14,13 +14,13 @@
<key>name</key>
<string>SMARTY_LDELIM</string>
<key>value</key>
- <string><![CDATA[{]]></string>
+ <string><![CDATA[<{ ]]></string>
@kujiy
kujiy / php-cs-fixer-ruleset.xml
Created February 22, 2016 00:40
php-cs-fixer-ruleset.xml
<ruleset name="Custom Standard">
<description>My custom coding standard</description>
<rule ref="PSR2">
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
<exclude name="Generic.Files.LineLength.TooLong"/>
<exclude name="Generic.Files.LineEndings.InvalidEOLChar"/>
@kujiy
kujiy / git_aliases
Last active May 3, 2017 14:11 — forked from numeraltwo/git_aliases
useful git and git-flow aliases
# GIT / GIT FLOW ALIASES
# https://gist.github.com/kujiy/c6afe3a8577e37af6566e1699bfc6f51
# alias gs="git status" # Unfortunately Ghost Script used `gs` already.
alias gss="git status"
alias gd="git diff"
alias gdc="git diff --cached"
gdn() { git diff --no-index -- $1 $2; }
alias gb="git branch"
alias gbr="git branch -r"