Skip to content

Instantly share code, notes, and snippets.

View chenko515's full-sized avatar
💭
Alive

NM055 chenko515

💭
Alive
View GitHub Profile

Keybase proof

I hereby claim:

  • I am chenko515 on github.
  • I am chenko515 (https://keybase.io/chenko515) on keybase.
  • I have a public key ASDXaxkUW7D-r6gaFpOO37hADbPTrFTZAYWvYPekz-zWDAo

To claim this, I am signing this object:

@chenko515
chenko515 / frontendDevlopmentBookmarks.md
Created January 24, 2016 05:32 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@chenko515
chenko515 / python_resources.md
Last active August 29, 2015 14:09 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@chenko515
chenko515 / PythonSourceEncoding
Created September 10, 2013 10:29
python source file encoding
http://www.python.org/dev/peps/pep-0263/
Defining the Encoding
Python will default to ASCII as standard encoding if no other
encoding hints are given.
To define a source code encoding, a magic comment must
be placed into the source files either as first or second
line in the file, such as:
@chenko515
chenko515 / .bashrc
Created September 2, 2013 02:04
aliases on mac
#######################################
# aliases defined by chenko on mac os x
#######################################
####################
#Temporary aliases:
####################
#change directory to django project mysite
<?php
$tel_no = $_GET['hm'];
$c = $_GET['c']?$_GET['c']:0;
$c++;
?>
<!DOCTYPE html>
<html>
<head>
<title>迷你轰炸台 - 短信炸弹 - BETA!</title>
<?php
首先打开“终端”(Finder->应用程序->实用工具->终端),并且输入以下命令:

defaults write com.apple.dock workspaces-edge-delay -float 0;killall Dock
现在大家试一下秒切吧。哈哈。。很爽不。是不是太快了,如果觉得太快,我们还可以在改改设定,我就设定在屏幕边缘停留半秒切换吧。
再次打开“终端”(Finder->应用程序->实用工具->终端),并且输入以下命令:
defaults write com.apple.dock workspaces-edge-delay -float 0.15;killall Dock
如果你想还原成原样,也很简单,再次打开“终端”(Finder->应用程序->实用工具->终端),并且输入以下命令:
defaults delete com.apple.dock workspaces-edge-delay;killall Dock
@chenko515
chenko515 / python3 with contextlib closing()
Created July 27, 2013 01:29
python3, with, contextlib, closing(), urlopen() using python3
from contextlib import contextmanager
@contextmanager
def closing(thing):
try:
yield thing
finally:
thing.close()
And lets you write code like this:
@chenko515
chenko515 / scrollToTheTop.js
Last active December 20, 2015 06:49
scroll to the top of any page via one line code saved as a chrome bookmark, using javascript
// Add a div node: "id=ele_top div" as the anchor at the top of the page
var addTop = function(){
ele_top = document.createElement('div');
ele_top.id = "ele_top";
document.body.insertBefore(ele_top, document.body.firstChild);
return true;
};
// Jump to the anchor node
var toTop = function(){