Skip to content

Instantly share code, notes, and snippets.

View coldnew's full-sized avatar
💭
I may be slow to respond.

Yen-Chin,Lee coldnew

💭
I may be slow to respond.
View GitHub Profile
@coldnew
coldnew / major-expand.el
Created September 14, 2012 15:39
a org-mode easy-template like plugin for yasnippet
(defun coldnew/major-mode-expand ()
"Try to complete a structure template before point like org-mode does.
This looks for strings like \"<e\" on an otherwise empty line and
expands them.
Before use this function, you muse setup `major-mode-name'-expand-alist variable.
Take emacs-lisp-mode as example, if you wand to use <r to expand your snippet `require'
in yasnippet, you muse setup the emacs-lisp-mode-expand-alist variable.
(setq emacs-lisp-expand-alist '((\"r\" . \"require\")))"
@coldnew
coldnew / gist:3858948
Created October 9, 2012 13:51
my org-mode latex class
(add-to-list 'org-export-latex-classes
'("coldnew-article"
"\\documentclass[12pt,a4paper]{article}
\\usepackage[T1]{fontenc}
\\usepackage{fontspec}
\\usepackage{xeCJK}
\\setCJKmainfont{Hiragino Sans GB W3}
\\XeTeXlinebreaklocale \"zh\"
\\XeTeXlinebreakskip = 0pt plus 1pt
\\usepackage{graphicx}
;;; org-html5presentation.el --- HTML5 Presentation export for Org-mode
;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; modified by leiyue for https://code.google.com/p/html5slides/
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.ogr
@coldnew
coldnew / english chinese font setting
Last active November 11, 2020 13:23
org-mode template for my chinese and english font setting
* 字體設置 :font:
** 英文字體與中文字體設置
- 英文字體
#+begin_src emacs-lisp
(defvar emacs-english-font "Monaco"
"The font name of English.")
#+end_src
(defvar emacs-english-font "Monaco"
"The font name of English.")
(defvar emacs-cjk-font "Hiragino Sans GB W3"
"The font name for CJK.")
(defvar emacs-font-size-pair '(15 . 18)
"Default font size pair for (english . chinese)")
(defun font-exist-p (fontname)
#This is how I got some of the window management gestures working on linux mint with the cinnamon frontend:
#install your stuff
sudo apt-get install xorg-xserver-mtrack xbindkeys xdotool
#fix mtrack conf
sudo mv /usr/share/X11/xorg.conf.d/50-mtrack.conf /usr/share/X11/xorg.conf.d/60-mtrack.conf
#configure xbindkeys
(
@coldnew
coldnew / gist:285654e41675d20e6d88
Last active August 29, 2015 14:04 — forked from jmvrbanac/gist:9963882
Install python-launchpadlib in Gentoo
# I use following command to install launchpadlib in Gentoo
pip install launchpadlib==1.10.2 --allow-external launchpadlib --allow-unverified launchpadlib --allow-external lazr.authentication --allow-unverified lazr.authentication
pip install lazr.restfulclient>=0.9.19 --allow-external lazr.authentication
# install wadllib (don't know why install by pip failed)
easy_install wadllib
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using DBus;
namespace IPChangerPrototype
{
public enum Method
From dac3e3b75f117dede7aa577d48fc10efb5a53dd1 Mon Sep 17 00:00:00 2001
From: Erik Larsson <erik@ortogonal.com>
Date: Thu, 30 Oct 2014 10:49:03 +0100
Subject: [PATCH] Add fix to get QtWayland Compositor running on iMX6.
This patch is not really done yet, it's just some test.
Change-Id: If57be6d26b3d56a772db73d29cede6215f033a80
Signed-off-by: Erik Larsson <erik@ortogonal.com>
---
@coldnew
coldnew / gist:cf3327e0c19565c67be9
Created January 26, 2015 01:36
Vmware Fusion 7 modules on Gentoo Linux Kerne 3.18 patch
diff -aurN a/vsock-only/linux/notify.c b/vsock-only/linux/notify.c
--- a/vsock-only/linux/notify.c 2014-11-18 10:08:42.000000000 +0800
+++ b/vsock-only/linux/notify.c 2015-01-26 09:17:54.440277630 +0800
@@ -515,8 +515,11 @@
vsk = vsock_sk(sk);
PKT_FIELD(vsk, sentWaitingRead) = FALSE;
#endif
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
sk->sk_data_ready(sk, 0);