Skip to content

Instantly share code, notes, and snippets.

@zhenyi2697
zhenyi2697 / gist:8fd24da8f765bf81bb16
Created April 30, 2014 13:56
dpkg: warning: 'ldconfig' not found in PATH or not executable.
Modify /etc/sudoers
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
java -Djava.library.path=/mnt/liting/jdk1.6.0_38/lib/ -jar minions.jar 9001 jedi004 9001 5
@zhenyi2697
zhenyi2697 / django_i18n_cheat_sheet.md
Last active August 29, 2015 14:11
Django i18n cheat sheet

1. Create Message file

Run the following command from

  • The root directory of Django project

  • The root directory of Django app

    $ django-admin.py makemessages
    or
    $ django-admin.py makemessages -l fr # to update message file

@zhenyi2697
zhenyi2697 / localstorage_test.js
Created July 8, 2015 20:11
JavaScript: Test localStorage
'use strict'
// The helper
(function(self) {
//helper guts goes here :)
//data store for holding objects
var localStore = {};

git里ignore文件有四种方式

  1. 最基本的,放在.gitignore里
  2. 还未track的文件,但是不想放到.gitignore里,可以放到 .git/info/exclude里

vim .git/info/exclude

  1. 已经track的文件,而且被本地修改了,想要ignore本地的修改

find ./ -name "*.launch" -exec git update-index --[no-]skip-worktree '{}' ;

@zhenyi2697
zhenyi2697 / git_ignore_files.txt
Last active September 15, 2015 11:26
Git Ignore files
There are 4 ways to ignore git files:
1. The most basic, add to .gitignore
2. Not yet tracked file, and don't want to add to .gitignore, can add to .git/info/exclude
This will just ignore files locally and the settings will not be shared with others
3. Already tracked files, and has already been modified locally, want to ignore local changes
git update-index --[no-]skip-worktree FILE_NAME // works for one file
@zhenyi2697
zhenyi2697 / gist:1973973
Created March 4, 2012 17:21 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@zhenyi2697
zhenyi2697 / git_store_credential_windows_from_1.7
Created October 20, 2015 08:10
Git store credential windows
git config --global credential.helper wincred
git config credential.helper 'cache --timeout=3600'
@zhenyi2697
zhenyi2697 / python_start_up.py
Created February 17, 2013 09:33
Python: start up
#!/usr/bin/python
# This is a start up list for python
# It will be used to quickly review the basic syntaxes and operations of python
# Code summerized from "简明 Python 教程" : http://woodpecker.org.cn/abyteofpython_cn/chinese/index.html
# Usually, python command options begin with two -- , e.g. --version --help
# Python Use True & False for boolean values
@zhenyi2697
zhenyi2697 / DateOperation.java
Created February 17, 2013 20:09
Java: Date operation
import java.util.Date;
import java.text.SimpleDateFormat;
import java.sql.Timestamp;
import java.lang.StringBuffer;
public class DateOperation{
private Date date;
public DateOperation(){