Skip to content

Instantly share code, notes, and snippets.

@inlinechan
inlinechan / qmake-mode.el
Created November 2, 2015 12:45
[WIP] qmake-mode by SMIE
;;; qmake-mode-el -- Major mode for editing QMAKE files
;; Author: Hyungchan Kim <inlinechan@gmail.com>
;; Created: 2 Nov 2015
;; Keywords: QMAKE major-mode
;; Copyright (C) 2015 Hyungchan Kim <inlinechan@gmail.com>
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@inlinechan
inlinechan / data.tsv
Last active March 3, 2016 08:13
d3 path transition example
id value
1 1000
2 1100
3 1150
4 1120
5 1200
6 1150
7 1100
@inlinechan
inlinechan / function.h
Last active May 12, 2016 14:01
functor
template <typename Sig>
class Function;
template <typename R, typename... Args>
class Function<R(Args...)> {
public:
typedef R(*Runtype)(Args...);
Function(Runtype f) : f_(f) {}
R operator()(Args... args) {
@inlinechan
inlinechan / parse-compdb.el
Created May 18, 2016 08:20
parse-compdb.el
;;; package --- Summary
;;; Commentary:
;;; Code:
(defun parse-compdb (db file)
"Parse compilation database DB of FILE and return list of include path."
(when (file-exists-p db)
(with-temp-buffer
@inlinechan
inlinechan / CMakeLists.txt
Last active October 25, 2016 02:25
clangtool
cmake_minimum_required(VERSION 2.8)
set(PROJECT_NAME finder)
project(${PROJECT_NAME})
option(test "Build all tests." OFF)
execute_process(COMMAND llvm-config-3.8 --cxxflags
OUTPUT_VARIABLE LLVM_CXXFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
;;; package --- Summary
;;; Commentary:
;; You may a hook for flycheck to set flycheck-clang-include-path automatically upon buffer open
;;
;; (add-hook 'flycheck-mode-hook
;; '(lambda()
;; (let ((include-path (compdb-get-include-path)))
;; (when include-path
@inlinechan
inlinechan / hc-org.el
Created November 23, 2016 14:29
org-clock
(setq org-clock-in-switch-to-state
#'(lambda (state)
(when (not (string= state "STARTED"))
"STARTED")))
(setq org-clock-out-switch-to-state
#'(lambda (state)
(when (not (string= state "WAITING"))
"WAITING")))
@inlinechan
inlinechan / chromium-search-class-decl.el
Created December 16, 2016 01:24
Find class definition in chromium
(defun hc/search-class-decl ()
(interactive)
(let ((pattern "^\'*class ?\\([A-Z_]+\\)? ?[A-Za-z0-9_]+"))
(isearch-forward-regexp nil 1)
(setq isearch-regexp t
isearch-string pattern
isearch-yank-flag t)
(isearch-search-and-update)))
@inlinechan
inlinechan / init.el
Created March 10, 2017 04:46
init.el use-package
;;; init.el --- My own emacs configuration
;; Copyright (C) 2017 Hyungchan Kim
;; Author: Hyungchan Kim <inlinechan@gmail.com>
;; Keywords: lisp use-package
;;; Commentary:
;; `use-package'
@inlinechan
inlinechan / save_mms.sh
Created May 22, 2017 07:47
save mms to mp3
#!/bin/bash
# for crontab
export PATH=$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
URL=mms://211.181.136.136/livefm
DESTDIR=$HOME/Music/chulsoo
RECIPIENT='foo@bar.com'
WAVFILE=$(date +\%Y\%m\%d\%H).wav
DURATION=3600