Skip to content

Instantly share code, notes, and snippets.

View petercommand's full-sized avatar
:octocat:
Github!

Ptrcmd petercommand

:octocat:
Github!
View GitHub Profile
$cat ~/.xsession
export XMODIFIERS="@im=hime"
export GTK_IM_MODULE=hime
export QT_IM_MODULE=hime
/usr/bin/hime &
$ git branch
caleb
* master
[peter@petercommand hime]$ git merge --ff caleb/master
Auto-merging configure
Removing distro/debian/HOBA/COPYING.png
Removing distro/debian/HOBA/COPYING.txt
Removing distro/debian/HOBA/SS1135_ST.jpg
Removing distro/debian/HOBA/SS1135_ST_75x75.jpg
Removing distro/debian/HOBA/SS1208_DT.jpg
@petercommand
petercommand / replace.sh
Created June 8, 2012 10:07 — forked from badsyntax/replace.sh
Simple recursive search and replace string in files
#!/usr/bin/env bash
#
# simple recursive search and replace string in files
# setup: alias replace='~/replace.sh'
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' .
# usage: replace <oldstring> <newstring> <path> <depth>
# examples:
# replace "([^\s]+.php)" "\/\1" .
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" .
@petercommand
petercommand / .profile fragment
Created June 30, 2012 07:39 — forked from jcamenisch/.profile fragment
Lightning-fast project-wide find/replace with git grep and sed
gg_replace() {
if [[ "$#" == "0" ]]; then
echo 'Usage:'
echo ' gg_replace term replacement file_mask'
echo
echo 'Example:'
echo ' gg_replace cappuchino cappuccino *.html'
echo
else
find=$1; shift
@petercommand
petercommand / gist:3047853
Created July 4, 2012 15:17
20120704-README
* * * * *
Hime 新手上路
=========
簡介
--
Hime 是一個極好用的輸入法框架, 輕巧、穩定、功能強大且支援許多常用的輸入法,包括倉頡, 注音,大易,行列,嘸蝦米 ,希臘字母,
日本Anthy, 韓拼, 拉丁字母, 亂倉打鳥, 酷音等....
euler:/ $ HOMEBREW_MAKE_JOBS=1 brew install -v pygobject 2>&1
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.bz2
Already downloaded: /Library/Caches/Homebrew/pygobject-2.28.6.tar.bz2
==> Verifying pygobject-2.28.6.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/pygobject-2.28.6.tar.bz2
==> Downloading http://git.gnome.org/browse/pygobject/patch/gio/gio-types.defs?id=42d01f060c5d764baa881d13c103d68897163a49
Already downloaded: /Library/Caches/Homebrew/pygobject--patch-6976bbad5212ae775e6715405e0e70e592356db2.defs
==> Verifying pygobject--patch-6976bbad5212ae775e6715405e0e70e592356db2.defs checksum
==> Patching
/usr/bin/patch -g 0 -f -d /private/tmp/pygobject-9TOy/pygobject-2.28.6 -p1 -i /private/tmp/pygobject--patch-BIsh/gio-types.defs
euler:~/LilyTerm $ ./configure
Checking GTK+2 ......................... [OK]
Checking VTE ........................... [OK]
Checking Native Language Support ....... [NO]
=================================================
PREFIX = /usr/local
ETCDIR = $(PREFIX)/etc/xdg
DEBUG = N
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
/*please note that this program treat type char as signed, different platform may produce different result */
typedef struct{
char str[12];
@petercommand
petercommand / gist:ac9a497c091c81a26436
Last active August 29, 2015 14:14
simple lisp calculator
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
enum {
OPERATOR,
NUMERAL,
SEPARATOR
};
enum {
module Main where
import Data.Map (Map)
import qualified Data.Map as M
import System.IO
import System.Environment
import Language.Haskell.Exts.Annotated
import Control.DeepSeq
import Control.Monad
import Debug.Trace