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 / pedal.ino
Created July 20, 2017 15:43
Foot pedal prototype
/*
* Foot pedal prototype
*/
#include <HID.h>
#include <Keyboard.h>
#define PIN_CTRL 2
#define PIN_ALT 3
#define PIN_SHIFT 4
(save-excursion
(setq xx-overlay (make-overlay (1+ (line-beginning-position)) (line-end-position)
nil t))
(overlay-put xx-overlay 'wrap-prefix t)
(overlay-put xx-overlay 'before-string
(propertize "o" 'display (list (list 'margin 'right-margin)
"Overlay text")
)))
@zeph1e
zeph1e / bashrc_id.sh
Created March 8, 2017 07:18
bashrc_id.sh
#!/bin/bash
export CRED=root@id
SSH=$(whereis ssh | awk '{print $2}')
JQ=$(whereis jq | awk '{print $2}')
SCP=$(whereis scp | awk '{print $2}')
if [ -z "$SSH" ]; then
echo "Unable to find ssh" 1>&2
return 1
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h>
@zeph1e
zeph1e / bashrc_no_gitps_for_nfs.sh
Last active April 22, 2016 04:22
Avoid $(git_ps) for NFS mounted directory
export NFS_MOUNT_PATH="$HOME/titan" # colon-separated list
export BACKUP_PS1=
function avoid_gitps_on_nfs() {
IFS=":"
set $NFS_MOUNT_PATH
for var in $NFS_MOUNT_PATH; do
if [ -n "`echo \"^$PWD\" | grep -e $var`" ]; then
export BACKUP_PS1=$PS1
export PS1=$NFS_PS1
(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
(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)
;; 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)))
/*
* 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>
' 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