Skip to content

Instantly share code, notes, and snippets.

View ozh's full-sized avatar
🍷
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

🍷
More wine, please.
View GitHub Profile
@ozh
ozh / phpxref_WP.bat
Created February 8, 2013 21:02
Switch config files for phpxref
@echo off
@copy /Y wpxref.cfg phpxref.cfg
@phpxref.exe
@ozh
ozh / userDefineLang.xml
Created February 14, 2013 13:42
Notepad++ : userDefineLang.xml for Markdown
<NotepadPlus>
<UserLang name="Markdown" ext="mkdn mkd md" udlVersion="2.0">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments" id="0">00# 00## 00### 00#### 00##### 01 02 03&lt;!-- 04--&gt;</Keywords>
<Keywords name="Numbers, additional" id="1"></Keywords>
<Keywords name="Numbers, prefixes" id="2"></Keywords>
@ozh
ozh / script.sh
Created April 3, 2013 09:21
Bash template script with argument
#!/bin/sh
usage() {
echo "usage: this that <param>"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
@ozh
ozh / kbd.h
Created April 8, 2013 20:10
Original kbd.h
/****************************** Module Header ******************************\
* Module Name: kbd.h
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Keyboard table values that form the basis for languages and keyboard types.
* The basis is US, kbd type 4 - all others are a variation on this.
* This file is included by all kbd**.h files.
*
* History:
@ozh
ozh / deletetags.sh
Created April 16, 2013 21:29
Git: delete all tags, locally and remotely
for t in `git tag`; do git tag -d $t; git push origin :$t; done
@ozh
ozh / gist:5406908
Created April 17, 2013 19:13
Create ~/.inputrc and fill it with this. Allows to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /".
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@ozh
ozh / notepad++_from_bash.md
Last active November 26, 2021 03:26
Open Notepad++ from BASH

in ~/.bash_profile : alias npp='~/npp'

in ~/npp :

#!/bin/sh

exec d:/utils/Notepad++/notepad++.exe "$@" &
@ozh
ozh / gist:5439013
Created April 22, 2013 22:10
Crontab template
MAILTO=""
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
@ozh
ozh / gist:5444908
Created April 23, 2013 16:01
Install PHPUnit from PHAR file

Download http://pear.phpunit.de/get/phpunit.phar

Edit ~/.bash_profile:

alias php="d:/online/xampp/php/php.exe"
alias phpunit="php d:/online/xampp/php/phpunit.phar"

In any directory: phpunit test.php

@ozh
ozh / gist:5453165
Created April 24, 2013 15:46
BASH: get latest tag from a project
#!/bin/bash
json=`curl -s -X GET https://api.github.com/repos/YOURLS/YOURLS/tags`
prop='name'
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo $temp | cut -d\ -f3