Skip to content

Instantly share code, notes, and snippets.

View opera443399's full-sized avatar
🎾
containerize myself

pc opera443399

🎾
containerize myself
View GitHub Profile
@opera443399
opera443399 / hellogist.md
Last active July 14, 2016 09:40
test gist

#标题前有一个#号

链接: here

图片: pcswo

引用:

our life is fritterd away by details, simplify, simplify

HEADERS
This is an H1
=============
This is an H2
-------------
# This is an H1
# grep -o 'UCanUup' UCloud.txt |wc -l
728
# python -c "import re
> c=0
> with open('UCloud.txt') as f:
> for line in f: c += len(re.findall(r'''\bUCanUup\b''', line))
> print c"
728
@opera443399
opera443399 / python_UnicodeEncodeError.py
Last active October 18, 2023 16:47
export PYTHONIOENCODING=UTF-8
from:
http://chase-seibert.github.io/blog/2014/01/12/python-unicode-console-output.html
Print to the console in Python without UnicodeEncodeErrors 12 Jan 2014
I can't believe I just found out about this! If you use Python with unicode data, such as Django database records, you may have seen cases where you print a value to the console, and if you hit a record with an extended (non-ascii) character, your program crashes with the following:
Traceback (most recent call last):
File "foobar.py", line 792, in <module>
print value
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
@opera443399
opera443399 / django_admin_actions.txt
Created July 3, 2017 03:49
admin actions for django
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/actions/
@opera443399
opera443399 / 如何贡献git代码
Created July 25, 2017 04:15
如何贡献git代码
如何贡献
在Github上Fork到自己的仓库
将fork后的项目拉到本地: git clone https://github.com/<user-name>/kubernetes-handbook
新建一个分支,并添加或编辑内容:git checkout -b new-branch
提交并推送到github:git commit -am "comments"; git push
在Github上提交Pull Request。
@opera443399
opera443399 / Contributing.md
Created October 10, 2017 07:27
Contributing Guidelines(from portainer)

Contributing Guidelines

Some basic conventions for contributing to this project.

General

Please make sure that there aren't existing pull requests attempting to address the issue mentioned. Likewise, please check for issues related to update, as someone else may be working on the issue in a branch or fork.

  • Please open a discussion in a new issue / existing issue to talk about the changes you'd like to bring
  • Develop in a topic branch, not master/develop