Skip to content

Instantly share code, notes, and snippets.

@RyanKung
RyanKung / emacs_24_2_fullscreen.patch
Last active December 11, 2015 01:38
no-lion-style fullscreen implementation for emacs 24.2, base on typester's patch.  The title-height will be set zero while 'ns-toggle-fullscreen.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 1aad645..51e41df 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -942,6 +942,12 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
+;; for fullscreen
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ())
@iwinux
iwinux / monssh.sh
Created October 31, 2012 01:49
monitor SSH status
#! /bin/bash
# usage: monssh [hostname]
if [[ -z $1 ]]
then
HOST="YOURHOST"
else
HOST=$1
fi
@don9z
don9z / gist:3617192
Created September 4, 2012 05:42
rm to trash
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(date +%H-%M-%S)
@henry0312
henry0312 / build_emacs24.2.sh
Created August 27, 2012 10:07
Build Emacs 24.2 on OS X 10.8.1
#!/bin/sh
# 初期設定
EMACS_VER=24.2
WORK_DIR=$HOME/Builds/Emacs
BUILD_DIR=$WORK_DIR/build
PATCH_DIR=$WORK_DIR/patch
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export CC='/usr/bin/clang'
@magnars
magnars / gist:3048595
Created July 4, 2012 17:57
cleanup-buffer.el
(defun cleanup-buffer-safe ()
"Perform a bunch of safe operations on the whitespace content of a buffer.
Does not indent buffer, because it is used for a before-save-hook, and that
might be bad."
(interactive)
(untabify-buffer)
(delete-trailing-whitespace)
(set-buffer-file-coding-system 'utf-8))
(defun cleanup-buffer ()
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 12, 2025 11:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@saetia
saetia / gist:1623487
Last active June 4, 2025 08:26
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@quietlynn
quietlynn / 12306.user.js
Created January 3, 2012 12:01
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011-2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...