Skip to content

Instantly share code, notes, and snippets.

@waltarix
waltarix / konsole_cjk_width.patch
Created March 23, 2012 02:29
konsole: Fix Ambiguous-width CJK treating problem.
diff --git a/src/konsole_wcwidth.cpp b/src/konsole_wcwidth.cpp
index 8613632..fcb8076 100644
--- a/src/konsole_wcwidth.cpp
+++ b/src/konsole_wcwidth.cpp
@@ -35,6 +35,12 @@ static int bisearch(quint16 ucs, const struct interval *table, int max) {
}
+int konsole_wcwidth(quint16 ucs)
+{
@waltarix
waltarix / htop-fix-curses-location.patch
Created March 23, 2012 09:15
htop: Fix "curses.h" location.
diff --git a/CPUMeter.c b/CPUMeter.c
index 90555ff..b6afea6 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -12,7 +12,7 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>
-#include <curses.h>
+#include <ncursesw/curses.h>
@waltarix
waltarix / fix-build-with-apache24.patch
Created March 27, 2012 08:48
subversion: Fix building issue with Apache 2.4
--- a/subversion/mod_dav_svn/util.c 2012-02-03 01:13:30.000000000 +0900
+++ b/subversion/mod_dav_svn/util.c 2012-03-27 16:30:43.806155945 +0900
@@ -627,8 +627,8 @@
if (errscan->desc == NULL)
continue;
- if (errscan->save_errno != 0) {
- errno = errscan->save_errno;
+ if (errscan->aprerr != 0) {
+ errno = errscan->aprerr;
@waltarix
waltarix / hahhah.patch
Created April 11, 2012 09:10
PowerLine meets HahHah
diff --git a/autoload/Powerline/Colorschemes/default.vim b/autoload/Powerline/Colorschemes/default.vim
index eacf147..a271f39 100644
--- a/autoload/Powerline/Colorschemes/default.vim
+++ b/autoload/Powerline/Colorschemes/default.vim
@@ -84,7 +84,7 @@ let g:Powerline#Colorschemes#default#colorscheme = Pl#Colorscheme#Init([
\ 'i': ['brightestred', ['bold']],
\ }),
\
- \ Pl#Hi#Segments(['current_function', 'fileformat', 'fileencoding', 'pwd', 'filetype', 'rvm:string', 'rvm:statusline', 'virtualenv:statusline', 'charcode', 'currhigroup'], {
+ \ Pl#Hi#Segments(['current_function', 'fileformat', 'fileencoding', 'pwd', 'filetype', 'rvm:string', 'rvm:statusline', 'virtualenv:statusline', 'charcode', 'currhigroup', 'hahhah'], {
@waltarix
waltarix / use-mouse-in-screen.patch
Created May 23, 2012 09:48
w3m: Use mouse in TERM=screen*
diff --git a/terms.c b/terms.c
index 7a3c987..6542d9f 100644
--- a/terms.c
+++ b/terms.c
@@ -494,7 +494,7 @@ static struct w3m_term_info {
{W3M_TERM_INFO("rxvt", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
{W3M_TERM_INFO("Eterm", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
{W3M_TERM_INFO("mlterm", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
- {W3M_TERM_INFO("screen", SCREEN_TITLE, 0)},
+ {W3M_TERM_INFO("screen", SCREEN_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
@waltarix
waltarix / httpstatus.zsh
Created February 24, 2013 09:20
implementation of httpstatus in zsh
function httpstatus {
local -A statuscode
statuscode=(
100 'Continue'
101 'Switching Protocols'
102 'Processing' # RFC 2518 (WebDAV)
200 'OK'
201 'Created'
202 'Accepted'
203 'Non-Authoritative Information'
@waltarix
waltarix / nacci.php
Created February 25, 2013 06:53
Fibo, Tribo and Tetra nacci number, Lucas number in PHP
<?php
const CALC_LIMIT = 1000;
// fibo
var_dump(implode(', ', nacci(CALC_LIMIT, [0, 1])));
// tribo
var_dump(implode(', ', nacci(CALC_LIMIT, [0, 0, 1])));
@waltarix
waltarix / runemacs.bat
Created February 25, 2013 10:59
emacs launcher for windows
@ECHO OFF
SET HOME=%~dp0
START /B %HOME%/bin/runemacs.exe
@waltarix
waltarix / ssssss.txt
Created March 27, 2013 15:17
ssssssss....
                
                
                
              
@waltarix
waltarix / peco_select_history
Last active August 29, 2015 14:16
peco_select_history for zsh
# vim:ft=zsh
whence peco &>/dev/null && function {
function peco_select_history {
emulate -L zsh
local delimiter=$'\0; \0' newline=$'\n'
BUFFER=${"$(print -rl ${history//$newline/$delimiter} | peco --query "$LBUFFER")"//$delimiter/$newline}
CURSOR=$#BUFFER