mkdir proj
cd proj
git init
git config user.name 'username'
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import fnmatch | |
def Walk(root='.', recurse=True, pattern='*'): | |
""" | |
Generator for walking a directory tree. | |
Starts at specified root folder, returning files | |
that match our pattern. Optionally will also |
(defun add-py-header () | |
"check and add # -*- coding: utf-8 -*-" | |
(interactive) | |
(let ((pyheader "# -*- coding: utf-8 -*-")) | |
(if (not (equal pyheader (buffer-substring-no-properties 1 (1+ (length pyheader))))) | |
(progn (goto-char 1) | |
(insert (concat pyheader "\n\n")))))) |
(cond | |
((= 23 emacs-major-version) | |
(if (file-exists-p "~/.emacs.d/emacs23.el") | |
(load-file "~/.emacs.d/emacs23.el"))) | |
((= 24 emacs-major-version) | |
(if (file-exists-p "~/.emacs.d/emacs24.el") | |
(load-file "~/.emacs.d/emacs24.el"))) | |
) |
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
$('.nav').css({'margin-bottom':'30px'}); | |
$('.nav-primary').css({'padding':0}); | |
$('.nav-logo a').attr('href', 'http://www.douban.com/update/'); | |
$('.nav-logo').css({'height':'52px'}); | |
$('#db-nav-sns .nav-items ul').append('<li><a href="http://www.douban.com/group/">小组</a></li>'); |
(defun switch-same-buffer-other-window() | |
"Open same buffer and switch to the other window." | |
(interactive) | |
(let ((cur-buf (current-buffer))) | |
(other-window 1) | |
(switch-to-buffer cur-buf))) | |
(global-set-key "\C-x\C-o" 'switch-same-buffer-other-window) |
(menu-bar-mode 0) | |
(tool-bar-mode 0) | |
;; (scroll-bar-mode 0) | |
(blink-cursor-mode 0) | |
(set-default-font "Source Code Pro 13") | |
;; format title bar to show full path of current file | |
(setq-default frame-title-format | |
(list '((buffer-file-name " %f" |
#!/bin/sh -xe | |
# Sets up m2crypto on ubuntu architecture in virtualenv | |
# openssl 1.0 does not have sslv2, which is not disabled in m2crypto | |
# therefore this workaround is required | |
PATCH=" | |
--- SWIG/_ssl.i 2011-01-15 20:10:06.000000000 +0100 | |
+++ SWIG/_ssl.i 2012-06-17 17:39:05.292769292 +0200 | |
@@ -48,8 +48,10 @@ |
mContext.registerReceiver( | |
new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
synchronized(mMethodMap) { | |
resetStateIfCurrentLocaleChangedLocked(); | |
} | |
} | |
}, filter); |