2016-12-26-Summrize

这是今天解决的三个问题:

  • 解决bootstrap glyphicon加载过慢
  • mysql命令行添加提示信息
  • python getpass模块用法

bootstrap glyphicon loading slow

Requirements

glyphicon glyphicon-info-sign loading too slow, sometimes I thinks it’s missing, is it possible to accelrate the downloading speed?

Solution

Use awesome to replace bootstrap glyphicon

1
2
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<i class="fa fa-info-circle" aria-hidden="true"></i>

Linux mysql 命令行使用技巧

Via

mysql在命令行内添加主机、数据库、用户名信息

编辑/etc/mysql/my.cnf,添加

1
2
[mysql]
prompt="\\u@\\h : \\d \\r:\\m:\\s>"

python getpass module usage & demo

refer link

introduction

getpass module is use for user to type in password

basic usage

1
2
3
4
5
6
7
8
import getpass

try:
p = getpass.getpass()
except Exception as err:
print('ERROR', err)
else:
print("You entered:", p)

with prompt

1
2
3
4
5
6
7
8
import getpass


p = getpass.getpass(prompt='What is your favorite color? ')
if p.lower() == 'blue':
print('Right, off you go.')
else:
print('Auuuuuugh!')
0%