Skip to content

Instantly share code, notes, and snippets.

View kujiy's full-sized avatar

Kujiy kujiy

View GitHub Profile
@kujiy
kujiy / Makefile
Created November 5, 2020 07:26 — forked from robstradling/Makefile
Parse Chrome EV metadata
chrome_ev:
gcc -o chrome_ev chrome_ev.cc
@kujiy
kujiy / nginx.conf
Created July 31, 2019 16:46 — forked from hiboma/nginx.conf
Nginx+Lua+Redis で動的upstream
worker_processes 1;
error_log /dev/stderr debug;
events {
worker_connections 256;
}
http {
server {
@kujiy
kujiy / ask.sh
Created February 24, 2017 01:45
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
local prompt default REPLY
while true; do
@kujiy
kujiy / vimdiff.md
Last active August 7, 2018 22:51 — forked from hyamamoto/vimdiff.md
The vimdiff cheat sheet as a git mergetool.

vimdiff cheat sheet

This is a vimdiff cheat sheet as a git mergetool.

Commands

]c - go to next difference 
<?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 / 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 / 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 / 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