Skip to content

Instantly share code, notes, and snippets.

;; Webpage: http://emacswiki.org/emacs/ParEdit
(require 'paredit)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode 1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode 1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode 1)))
(add-hook 'python-mode-hook (lambda () (paredit-mode 1)))
(add-hook 'scheme-mode-hook (lambda () (paredit-mode 1)))
(add-hook 'clojure-mode-hook (lambda () (paredit-mode 1)))
;;https://github.com/grettke/parenface
@frankyxhl
frankyxhl / internalLinkAnimation
Created May 25, 2015 04:16
webpage internal link animation
$(function(){
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
@frankyxhl
frankyxhl / emacs-indent-tab-mode.el
Created July 31, 2012 18:59
emacs-indent-tab-mode problem
(defun indent-hint-mode (&optional l lst)
(interactive)
(let* ((c '(indent-hint-current-column))
(lst (or lst '(("^[ \t]*\\([^ \t]\\)"))))
(lst (if l lst (reverse lst))))
(indent-hint-init l)
(dolist (x lst)
(indent-hint (car x) c (cadr x)))))
;;根据上面的mode改进的希望的tab mode
(defun indent-hint-tab-mode (&optional l lst)
@frankyxhl
frankyxhl / gist:3769394
Created September 23, 2012 08:48
My github blog sass file
// This File is imported last, and will override other styles in the cascade
// Add styles here to make changes without digging in too much
html{
background: url('/images/bg.png') repeat center top;
}
body > header{
background-color: transparent;
}
@frankyxhl
frankyxhl / gist:3775217
Created September 24, 2012 09:53
snippet_python_def
# -*- coding: utf-8 -*-
# name: def
# contributor: Orestis Markou
# contributor: Yasser González Fernández <yglez@uh.cu>
# key: def
# --
def ${1:name}($2):
"""$3
${2:$
(let*
@frankyxhl
frankyxhl / gist:3780429
Created September 25, 2012 07:18
swap-command-and-option-key-in-mac
(setq mac-option-key-is-command t)
(setq mac-option-modifier 'super)
(setq mac-command-key-is-meta t)
(setq mac-command-modifier 'meta)
@frankyxhl
frankyxhl / gist:4122935
Created November 21, 2012 04:01
RubyConfChina_Feedback
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
# @date: 2012-11-20
# @author: Frank_Xu franky.xhl[at]gmail.com I'm a Ruby Newbie~
# 变量设定
# qn = question number count
qn = 13
# filename
filename = "rslt.txt"
(eval-when (:compile-toplevel :load-toplevel :execute)
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(when (probe-file quicklisp-init)
(load quicklisp-init))))
(ql:quickload '(:split-sequence :alexandria))
(use-package :alexandria)
;; Color Spade 黑桃 Heart 红心 Diamond 红钻 Club 黑莓
@frankyxhl
frankyxhl / sr-speedbar-emacs-config.el
Created September 25, 2012 07:07
sr-speedbar-emacs-config
;;===========================================================================
;;sr-speedbar-mode
;;===========================================================================
(require 'sr-speedbar)
;;默认显示所有文件
(custom-set-variables
'(speedbar-show-unknown-files t)
)
;;sr-speedbar-right-side 把speedbar放在左侧位置
;;sr-speedbar-skip-other-window-p 多窗口切换时跳过speedbar窗口
// ==UserScript==
// @name RemoveAdsOnSalangane-books
// @namespace salangane_books
// @author Frank_Xu
// @include http://salangane-books.com/*
// @version 1
// @grant none
// ==/UserScript==
// 本脚本去掉海燕烦人的广告