Skip to content

Instantly share code, notes, and snippets.

View leopku's full-sized avatar

Song Liu leopku

View GitHub Profile
@leopku
leopku / nginx.conf
Created December 8, 2013 11:59 — forked from leon/nginx.conf
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@leopku
leopku / foo.rb
Created January 27, 2014 15:14 — forked from tenderlove/foo.rb
require 'rubygems'
require 'nokogiri'
class MyFilter
def ends_with set, ends
set.map { |x| x.to_s }.join.end_with? ends
end
end
doc = Nokogiri.XML(DATA)
@leopku
leopku / fino-simplify.zsh-theme
Last active August 29, 2015 14:03
simplified zsh theme of fino
# fino-simplify.zsh-theme
# simplified [fino](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/fino.zsh-theme) zsh theme.
# Display current user, host name, current dir, git info & ruby version one line.
function prompt_char {
git branch >/dev/null 2>/dev/null && echo "±" && return
echo '$'
}
.modal {
width: 800px;
left: 40%;
}
.lightbox-content {
width: 100%;
}
.lightbox-image {
@leopku
leopku / Bracket Settings - User
Created July 29, 2014 02:15
Bracket Highlighter User Settings
{
"bracket_styles": {
"default": {
"icon": "dot",
"color": "brackethighlighter.default",
"style": "outline"
},
"unmatched": {
"icon": "question",
"color": "brackethighlighter.unmatched",
@leopku
leopku / index.js
Created August 22, 2014 03:22 — forked from edokeh/index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
RUBY_GC_HEAP_FREE_SLOTS=600000
RUBY_GC_HEAP_GROWTH_FACTOR=1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS=300000
RUBY_GC_HEAP_INIT_SLOTS=600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
RUBY_GC_MALLOC_LIMIT=64000000
RUBY_GC_OLDMALLOC_LIMIT=64000000
RUBY_HEAP_FREE_MIN=12500
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_HEAP_SLOTS_INCREMENT=100000
@leopku
leopku / info.sh
Last active August 29, 2015 14:11 — forked from mikepenz/multitail.md
# Run following command:
curl https://gist.githubusercontent.com/mikepenz/a8a4a52f67a391895a4c/raw/22db5a0c3b009442a9ff8fd454e08f429d706c8c/multitail.sh | sh; source ~/.bashrc
# This will start the script multitail.sh and call source ~/.bashrc afterwards
#try to run
#logt (log-tomcat) output normal /usr/local/tomcat/logs/catalina.out or /var/www/tomcat/logs/catalina.out
logt
#logt (log-tomcat) output overwrite tomcat or logfile /usr/local/$1/logs/$2 or /var/www/$1/logs/$2
logt $1 $2
@leopku
leopku / clone
Created June 14, 2015 02:32
deep copy in javascript
function clone(obj) {
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;
// Handle Date
if (obj instanceof Date) {
var copy = new Date();
copy.setTime(obj.getTime());
return copy;
}
@leopku
leopku / index.html
Last active August 29, 2015 14:23 — forked from anonymous/index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<path d="
M 18 191 L 58.1684 191 L 58.1684 129.1406 L 73.5454 112.6903