Skip to content

Instantly share code, notes, and snippets.

View lululau's full-sized avatar
🎯
Focusing

FCP lululau

🎯
Focusing
  • Sunshine, Mountain East
View GitHub Profile
map <c-c> <esc>
@lululau
lululau / projectile-rails.el
Last active November 19, 2015 06:39
Monkey-patched projectile-rails.el
(defun binding-pry-filter (text)
(if (string-match "^ => [0-9]+:" text) (pop-to-buffer (current-buffer))))
(defun projectile-rails-server (port)
(interactive "P")
(require 'inf-ruby)
(if (not port) (setq port 3000))
(projectile-rails-with-root
(progn
(if (not (comint-check-proc inf-ruby-buffer)) (rvm-activate-corresponding-ruby))
@lululau
lululau / helm-gtags.el
Created July 23, 2015 16:04
Put the tag defined in the same file with current buffer most above when there are more than one tags found and one tags found in buffer-file-name.
(defun helm-gtags--exec-global-command (type input &optional detail)
(let ((args (helm-gtags--construct-command type input)))
(helm-gtags--find-tag-directory)
(helm-gtags--save-current-context)
(let ((buf-coding buffer-file-coding-system) (current-buffer-filename (buffer-file-name)))
(with-current-buffer (helm-candidate-buffer 'global)
(let ((default-directory (helm-gtags--base-directory))
(input (car (last args)))
(coding-system-for-read buf-coding)
(coding-system-for-write buf-coding))
@lululau
lululau / ox-confluence.el
Created November 20, 2015 15:10
ox-confluence.el
;;; ox-confluence --- Confluence Wiki Back-End for Org Export Engine
;; Copyright (C) 2012, 2014 Sébastien Delafond
;; Author: Sébastien Delafond <sdelafond@gmail.com>
;; Keywords: outlines, confluence, wiki
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
@lululau
lululau / ox-confluence.el
Created November 20, 2015 15:10
ox-confluence.el
;;; ox-confluence --- Confluence Wiki Back-End for Org Export Engine
;; Copyright (C) 2012, 2014 Sébastien Delafond
;; Author: Sébastien Delafond <sdelafond@gmail.com>
;; Keywords: outlines, confluence, wiki
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
@lululau
lululau / wiki.lua
Created March 17, 2016 13:01 — forked from zhzhxtrrk/wiki.lua
pandoc confluence markup writer
-- that is very similar to that of pandoc's HTML writer.
-- There is one new feature: code blocks marked with class 'dot'
-- are piped through graphviz and images are included in the HTML
-- output using 'data:' URLs.
--
-- Invoke with: pandoc -t sample.lua
--
-- Note: you need not have lua installed on your system to use this
-- custom writer. However, if you do have lua installed, you can
-- use it to test changes to the script. 'lua sample.lua' will
#!/usr/bin/env ruby
require 'shellwords'
DEFAULT_SPEC_MATCH_RULES = {
/.*/ => ->(file) { file.sub(%r{^[^/]+}, 'spec').sub(/\.(rb|rake)$/, '_spec.rb') }
}
def get_rspec_file(file)
if file.start_with?('spec/')
#!/usr/bin/env ruby
require 'zip' # gem install rubyzip
require 'optparse'
require 'ostruct'
ARGV << '--help' if ARGV.empty?
options = OpenStruct.new(from_code: Encoding.default_external,
to_code: Encoding.default_external)
@lululau
lululau / gpg-agent.conf
Created December 17, 2016 14:11 — forked from nl5887/gpg-agent.conf
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@lululau
lululau / _tmux_pane_words.zsh
Created December 17, 2016 15:41 — forked from blueyed/_tmux_pane_words.zsh
ZSH configuration to complete words from tmux pane(s)
# Complete words from tmux pane(s) {{{1
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html
# Gist: https://gist.github.com/blueyed/6856354
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi