Skip to content

Instantly share code, notes, and snippets.

View harrifeng's full-sized avatar

Harri Feng harrifeng

View GitHub Profile
@harrifeng
harrifeng / index.html
Created September 1, 2018 03:23
JS Bin [add your bin description] // source https://jsbin.com/xexivaw
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.js" integrity="sha256-Ezb5Nri+VAO8xJDHLcPCxS70Kfh+MUFw9OXLZZrdfCs=" crossorigin="anonymous"></script>
</head>
<body>

Bento, a project by the same company that makes Chef, is a Packer-based project for building base boxes. Unlike http://vagrantbox.es, Bento just uses base operating systems from the manufacturers with no pre-installed software. All the boxes are hosted on S3 in the following format:

https://opscode-vm-bento.s3.amazonaws.com/vagrant/PROVIDER/opscode_OS-VERSION_chef-provisionerless.box

For example, Ubuntu 13.04 lives here for VirtualBox:

https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-13.04_chef-provisionerless.box

And the VMWare equivalent box lives:

def display(one):
print(type(one))
display(1)
display(i for i in range(32))
# <===================OUTPUT===================>
import logging
from logging.handlers import RotatingFileHandler
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s(%(lineno)d) %(message)s')
logFile = '/tmp/demo.log'
my_handler = RotatingFileHandler(logFile, mode='a', maxBytes=5*1024*1024,
backupCount=2, encoding=None, delay=0)
my_handler.setFormatter(log_formatter)
>>> int('f', 16)
15
>>> hex(15)
'0xf'
a = bytes.fromhex('C3 A9')
u = a.decode('utf8')
print(u)
6.10.2. Membership test operations¶
The operators in and not in test for membership. x in s evaluates to True if x is a member of s, and False otherwise. x not in s returns the negation of x in s. All built-in sequences and set types support this as well as dictionary, for which in tests whether the dictionary has a given key. For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression x in y is equivalent to any(x is e or x == e for e in y).
For the string and bytes types, x in y is True if and only if x is a substring of y. An equivalent test is y.find(x) != -1. Empty strings are always considered to be a substring of any other string, so "" in "abc" will return True.
For user-defined classes which define the __contains__() method, x in y returns True if y.__contains__(x) returns a true value, and False otherwise.
For user-defined classes which do not define __contains__() but do define __iter__(), x in y is True if some value z with x == z is produced while iterat
中英文字体名对照表(包括方正、文鼎),中英文方正
在CSS文件中,我们常看到有些字体名称变成了乱码,这是由于编写者将中文字体的名字直接写成了中文,为了避免这种状况出现,在CSS文件中使用中文字体时,最好使用中文字体的英文名称,需要的朋友可以注意下
新細明體 PMingLiU
細明體 MingLiU
標楷體 DFKai-SB
黑体 SimHei
宋体 SimSun
新宋体 NSimSun
中英文字体名对照表(包括方正、文鼎),中英文方正
在CSS文件中,我们常看到有些字体名称变成了乱码,这是由于编写者将中文字体的名字直接写成了中文,为了避免这种状况出现,在CSS文件中使用中文字体时,最好使用中文字体的英文名称,需要的朋友可以注意下
新細明體 PMingLiU
細明體 MingLiU
標楷體 DFKai-SB
黑体 SimHei
宋体 SimSun
新宋体 NSimSun
while sleep 3; do ps aux | grep hfeng | wc -l ; done