Skip to content

Instantly share code, notes, and snippets.

@gilchris
gilchris / start_stop_skeleton.sh
Last active July 28, 2016 01:14
ShellScript Skeleton for service start and stop
#/bin/sh
case "$1" in
start)
;;
stop)
;;
restart)
$0 stop
$0 start
@gilchris
gilchris / redmine_issue_highlighter.js
Last active October 13, 2016 08:56
Add to row background color on Redmine issues
(function() {
var colors = {
"1": "#aea", // 신규
"2": "#bfb", // 진행
"3": "#ccc", // 해결
"4": "#ff9", // 의견
"5": "#aaa", // 완료
"9": "#efa", // 보류
"10": "#ff9" // 의견
};
@gilchris
gilchris / ncare_onnuri.js
Last active October 24, 2017 16:12
온누리교회 nCare 이용에 도움을 주는 TemperMonkey용 스크립트
// ==UserScript==
// @name Onnuri nCare Attendance
// @namespace http://icare.ionnuri.org/
// @version 0.3
// @description try to take over the world!
// @author gilchris
// @match http://*/*
// @grant none
// ==/UserScript==
@gilchris
gilchris / redmine_issue_time.js
Created March 10, 2017 01:27
Adding detail date and time info on Redmine issue page.
(function() {
if (location.href.indexOf('/issues/') > -1) {
$("a[title^='20']").each(function() { $(this).text($(this).text() + " (" + $(this).attr('title') + ")"); });
}
})();
@gilchris
gilchris / redmine_my_issue_highlighter.user.js
Last active November 6, 2017 09:03
Adding to highlighting login user name on redmine issue rows.
// ==UserScript==
// @name Redmine My Issue Highlighter
// @namespace https://gist.github.com/gilchris/71bb6c44625722e0ae0d31ea0378e788
// @include /^.*redmine.*$/i
// ==/UserScript==
(function() {
var activeUserLink = $("div[id='loggedas'] > a").attr('href');
$("a[href='" + activeUserLink + "']").each(function() { $(this).html("<b style='color:#000000'>" + $(this).html() + "</b>"); });
})();
@gilchris
gilchris / StopWatch.java
Created March 14, 2017 05:49
Simple running time checker
import android.util.Log;
public class StopWatch {
private static String TAG = "StopWatch";
private static long baseTime;
private static long lastCheckTime;
private static long nowTime;
@gilchris
gilchris / pytest.bat
Created August 16, 2017 08:39
Pytest example for windows
@ECHO OFF
set PYTHONDONTWRITEBYTECODE=1
set PYTHONPATH=..\src
C:\Python35\Scripts\pytest.exe %*
@gilchris
gilchris / hosts_administrator.ps1
Created November 27, 2017 06:37
Execute notepad with hosts file as administrator
Start-Process -FilePath C:\Windows\notepad.exe -ArgumentList "C:\Windows\System32\drivers\etc\hosts" -Verb runAs
@gilchris
gilchris / getQuery.js
Last active November 30, 2017 07:42
get parameter value from url
// https://stackoverflow.com/a/35430091/1615988
function getQuery(q) {
return (window.location.href.match(new RegExp('[?&]' + q + '=([^&]+)')) || [, null])[1];
}
@gilchris
gilchris / del_nohup.sh
Created December 17, 2018 09:15
Delete 'nohup.out' files In sub directories
rm -f $(find . 'nohup.out' | grep nohup.out)