Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile
<?php
// Use in the "Post-Receive URLs" section of your Bitbucket repo.
if ( $_POST['payload'] ) {
$data = json_decode($_POST['payload']);
$commits = $data->{"commits"};
@kujiy
kujiy / github_post_recieve.php
Last active May 19, 2016 10:11 — forked from cowboy/github_post_recieve.php
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
$path = "/var/www/html/abc";
if ( $_POST['payload'] ) {
shell_exec( 'cd '.$path.' && git reset --hard HEAD && git pull 2>&1' );
}
@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"
@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 / 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 / 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 / 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 / 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"]
#!/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 / 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 ✓