Skip to content

Instantly share code, notes, and snippets.

View zeph1e's full-sized avatar

Yunsik Jang zeph1e

  • LG Electronics, Inc.
  • Seoul, Korea
View GitHub Profile
@zeph1e
zeph1e / Makefile
Created February 6, 2014 08:16
Makefile Template for small project
# Makefile template for small project
# Yunsik Jang <doomsday@kldp.org>
SYSROOT=/
# If you use custom toolchain specify it
TOOLCHAIN_PATH :=
TOOLCHAIN_PREFIX :=
ifneq ($(strip $(TOOLCHAIN_PATH)),)
@zeph1e
zeph1e / smaps_parse.cpp
Created September 11, 2014 01:45
parse smaps & collect memory usage by owner. It can dump all result or make a spread sheet entry for specific category (like PSS)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include <errno.h>
#include <vector>
#include <unistd.h>
#include <unordered_map>
#define LINEBUFMAX 1024
"-----------------------------------------------------------
" GENERAL
"----------------------------------------------------------
" history
set history=700
" enable filetype plugins
filetype plugin on
filetype indent on
#!/bin/sh
XINPUT="xinput"
TP_KEYWORD="Touchpad"
TP_CMD=
TP_ID=`$XINPUT | grep $TP_KEYWORD | awk -F '=' '{ print $2; }' | awk '{ print $1; }'`
if [ -z "$TP_ID" ]; then
echo "Unable to find touchpad" 1>&2
exit 1
@zeph1e
zeph1e / autosubdir.pro
Created June 10, 2015 16:00
qmake: auto subdir
# automatically add existing sub directories to SUBDIRS
TEMPLATE = subdirs
SUBDIRS = $$system("ls -d */ | cut -f1 -d'/'")
' emx.vbs : starts a emacsclient with no command prompt
Dim emxCmd
Set WshShell = Createobject("WScript.Shell") Set Args =
WScript.Arguments emxCmd = """emacsclient"" ""-cqa"" ""emacs""" For
index = 0 To (Args.Count - 1) emxCmd = emxCmd & Chr(32) & Chr(34) &
Args(index) & Chr(34) Next WshShell.Run emxCmd, 0 Set WshShell =
Nothing
/*
* RPM C API test based on :
* http://rpm5.org/docs/api/rpminstall_8c-source.html#l00287
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <rpm/rpmlib.h>
;; handle left click on left window margin & return text in position
(global-set-key (kbd "<left-margin> <mouse-1>") (lambda (p) (interactive "e")
(message "%S" (posn-string (car (cdr p))))))
;; unset key bind
(global-unset-key (kbd "<left-margin> <mouse-1>"))
;; make overlay on window start pos & insert propertized text
;; mouse-face doesn't work but help echo works..... weird....
(let ((str (propertize "hello" 'face '(:foreground "cyan") 'help-echo "mouse-1: say hello" 'mouse-face 'highlight)))
(setq ov (make-overlay (window-start) (window-start)))
(defun my:background-at-point ()
(let* ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face)))
(bg (cond ((and face (symbolp face))
(condition-case nil
(face-background face nil 'default)
(error (or (face-background face)
(cdr (assq 'background-color (frame-parameters)))))))
((consp face)
(cond ((memq 'background-color face)
(require 'auto-complete)
(defvar ac-emacs-lisp-sources
'(ac-source-symbols))
(defvar ac-emacs-lisp-features nil)
(defvar ac-source-emacs-lisp-features
'((init
. (lambda ()
(unless ac-emacs-lisp-features