Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Focusing

Yuan He lenage

:octocat:
Focusing
View GitHub Profile
@lenage
lenage / setup-git-server.md
Last active Mar 25, 2016
How to set up your own private Git server on Linux
View setup-git-server.md

1.安装Git

ssh myserver.com
sudo apt-get update
sudo apt-get install git-core

2.设置git用户

@lenage
lenage / csv_to_yaml.rb
Created Jul 8, 2013
Convert csv file to YAML
View csv_to_yaml.rb
require 'csv'
class String
def unquote
self.gsub(/^"|"$/, '')
end
end
# first line contains the field names
#line = gets
View myapp.conf
upstream myapp {
server 127.0.0.1:5000;
}
server {
listen 80;
server_name llbire.com www.llbire.com;
location @myapp {
proxy_pass http://myapp;
@lenage
lenage / search_domain.py
Created Nov 30, 2012 — forked from lintianzhi/search_domain.py
search availible domain name
View search_domain.py
#!/usr/bin/python
#coding=utf-8
import urllib
import urllib2
import re
import threading
import Queue
url = 'https://who.is/whois/name_search/'
@lenage
lenage / jeykll-hight.el
Created Nov 30, 2012
jeykll highlight lisp code
View jeykll-hight.el
{% highlight cl linenos %}
(require 'package)
(setq package-archives
'(("original" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
{% endhighlight %}
@lenage
lenage / command_tips.md
Created Nov 10, 2012
command line fu & tips
View command_tips.md

Command line tips

1.list all keycode

    xmodmap -pke

2.rename当前目录和子目录下所有.html.erb.html

@lenage
lenage / example.lsp
Created Nov 6, 2012
some common lisp stuffs
View example.lsp
(defun our-copy-tree (tr)
(if (atom tr)
tr
(cons (our-copy-tree (car tr))
(our-copy-tree (cdr tr)))))
(defun get_max_v1 (lst)
(if (null lst)
"没有要比较的元素"
(if (null (cdr lst))
@lenage
lenage / wait_until.rb
Created Nov 5, 2012 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
View wait_until.rb
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
View .tmux.conf
set -g default-terminal "screen-256color"
set -g history-limit 20000
# use VI
set-window-option -g mode-keys e
# Use ctrl-a instead of ctrl-b
set -g prefix C-a
unbind C-b
bind C-a send-prefix
You can’t perform that action at this time.