Skip to content

Instantly share code, notes, and snippets.

@yiufung
yiufung / init.el
Created January 16, 2019 08:10
Quote blocks not rendered in Poet
;; -*- coding: utf-8 -*-
;;; Init file to work with full org babel config
;; UTF-8 everywhere please
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-language-environment 'utf-8)
@yiufung
yiufung / init.el
Created January 16, 2019 02:31
leuven-theme in moody
;; -*- coding: utf-8 -*-
;; UTF-8 everywhere please
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-language-environment 'utf-8)
@yiufung
yiufung / init.el
Last active September 28, 2018 14:50
org-mu4e-store-and-capture
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
@yiufung
yiufung / init.el
Created September 19, 2018 06:11
Reproduce: `xdg-open` doesn't work in Ubuntu for `counsel-locate-action-extern`
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
@yiufung
yiufung / python-in-emacs.el
Last active September 28, 2019 04:03
Minimal setup for Python under Emacs: company-mode+anaconda-mode+company-anaconda+company-quickhelp
;; Note:
;; Tool selection may be jedi, or anaconda-mode. This script settle it
;; down with anaconda-mode.
(use-package company
:ensure t
:config
(setq company-idle-delay 0
company-minimum-prefix-length 2
company-show-numbers t
@yiufung
yiufung / use-package-with-pdf-tools.el
Last active July 22, 2018 17:37
Emacs: Use pdf-tools under Windows
;; m-parashar has released pre-compiled pdf-tools for Windows at
;; https://github.com/m-parashar/emax64/releases/download/20180529/pdf-tools-20180428.827.7z
;; Extract it and change :load-path accordingly.
(use-package pdf-tools
;; Dependency of pdf-tools
:ensure tablist
:load-path (lambda () (expand-file-name "bin/pdf-tools-20180428.827/"
my-emacs-conf-directory))
;; Tell Emacs to autoload pdf-tools
:init (load "pdf-tools-autoloads" nil t)
@yiufung
yiufung / get_long_songs.py
Last active August 29, 2015 14:25
Get songs longer than a specified value by an artist. Require Spotipy: https://github.com/plamere/spotipy
import spotipy, sys
def get_artist(name):
results = sp.search(q='artist:' + name, type='artist')
items = results['artists']['items']
if len(items) > 0:
return items[0]
else:
return None
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )