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
@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 / HelloWorld.java
Created February 24, 2012 17:20
Gist Test
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
@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 / 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 / test
Created January 22, 2013 15:48
test
~ $ cat test.sh
#!/bin/bash
function hello() {
echo "ARG1: $1"
echo "ARG2: $2"
echo "ARG3: $3"
}
echo "ARG_1: $1"
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# -*- ruby -*-
require 'optparse'
NOW = Time.now
CONTENT_TYPE_MAP = {
"app" => "com.apple.application-bundle",
_autojump()
{
local cur
cur=${COMP_WORDS[*]:1}
comps=$(autojump --bash --complete $cur)
while read i
do
COMPREPLY=("${COMPREPLY[@]}" "${i}")
done <<EOF
$comps
#!/opt/local/bin/python2.7
# -*- coding: utf-8 -*-
"""
Copyright © 2008-2012 Joel Schaerer
Copyright © 2012 William Ting
* This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
#!/usr/bin/env python
import sys
import getopt
import re
import types
#
# Originally written by Einar Lielmanis et al.,
# Conversion to python by Einar Lielmanis, einar@jsbeautifier.org,
#!/usr/bin/env perl
my $bounds_string = join "", <>;
$bounds_string =~ s#\{#[#g;
$bounds_string =~ s#\}#]#g;
eval 'our $bounds = ' . $bounds_string;
my %apps = ();
for my $window (@$bounds) {
my $app_name = $window->[0];
my $window_title = $window->[1];