最近的 deletefacebook 轰轰烈烈,不知道什么时候就会有 deletetwitter deletegoogle 发生。使用互联网服务应该要有这样的觉悟:用了人家的服务,就会被当猪仔卖的。
March 26, 2018
博客文章(多行文本)的部分显示,除了编辑文章的时候自己截断,基本没看到有靠谱的解决方案。用 JS 截断,会遇到各种 HTML 标签,或者是空行。视觉上,还是加渐变遮罩更容易让人接受。
March 14, 2018
GAE 使用的 jinja2 2.6x 版本的 filesizeformat 过滤器有 bug,2.7版本中已经修复,所以暂时只能自定义过滤器。
March 13, 2018
No comments
- def do_filesizeformat(value, binary=False):
- """Format the value like a 'human-readable' file size (i.e. 13 kB,
- 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega,
- Giga, etc.), if the second parameter is set to `True` the binary
- prefixes are used (Mebi, Gibi).
- """
- bytes = float(len(value))
- base = binary and 1024 or 1000
- prefixes = [
- (binary and 'KiB' or 'kB'),
- (binary and 'MiB' or 'MB'),
- (binary and 'GiB' or 'GB'),
- (binary and 'TiB' or 'TB'),
- (binary and 'PiB' or 'PB'),
- (binary and 'EiB' or 'EB'),
- (binary and 'ZiB' or 'ZB'),
- (binary and 'YiB' or 'YB')
- ]
- if bytes == 1:
- return '1 Byte'
- elif bytes < base:
- return '%d Bytes' % bytes
- else:
- for i, prefix in enumerate(prefixes):
- unit = base ** (i + 2)
- if bytes < unit:
- return '%.1f %s' % ((base * bytes / unit), prefix)
- return '%.1f %s' % ((base * bytes / unit), prefix)
Google Appengine 通过 SDK 上传要用到代理,直接写成批处理命令,不用每次输入代理地址了。
March 13, 2018
No comments
- @echo off
- rem "关闭自动输出"
- rem "接收输入"
- set input=
- set /p input=The proxy port:
- rem "输出得到的输入信息"
- echo Set the proxy port:%input%
- echo Set the the http proxy...
- set http_proxy=http://127.0.0.1:%input%
- echo http_proxy=http://127.0.0.1:%input%
- echo Set the the https proxy...
- set https_proxy=http://127.0.0.1:%input%
- echo https_proxy=http://127.0.0.1:%input%
- :begin
- echo.
- set /p input1=Which folder do you want to upload:
- appcfg.py update ..\codes\%input1% --noauth_local_webserver
- rem pause>null
- echo.
- rem "从begin标签处,再次运行"
- goto begin
Hi-PDA论坛stylish绿色护眼样式
December 25, 2017
22:04 PM, Mar 07
弯腰去捡
October 29, 2012
22:23 PM, Mar 07
在博客文章编辑功能上,借鉴 wiki 的做法,引入了 diff 机制,不过文章还是只保留有一个版本。这样从理论上来说,发表过的文章里面每一个字都会一直保留下去,除非删除文章。好处是让你写文章的时候谨慎一点,能够完全为你写的文字负责;坏处就是可能因为某个字词不恰当要删除整篇文章或者重新写。为了防止这样极端的情况出现,还是把普通编辑功能留了下来。
September 16, 2012
激活 Windows 8 RTM 版本
September 10, 2012