This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createStyles, | |
Paper, | |
Table, | |
TableBody, | |
TableCell, | |
TableHead, | |
TableRow, | |
Theme, | |
withStyles, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################## | |
# | |
# 使用youtube-dl库下载 | |
# https://github.com/rg3/youtube-dl | |
# | |
######################################## | |
# 腾飞五千年系列———中华文明起源 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
Bucket: | |
Type: 'AWS::S3::Bucket' | |
Properties: | |
AccessControl: PublicRead | |
WebsiteConfiguration: | |
IndexDocument: index.html | |
ErrorDocument: error.html | |
Distro: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing mysql 5.7 on centos 6 | |
1. download yum repo | |
wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm | |
2. install yum repo | |
yum -y localinstall mysql57-community-release-el6-7.noarch.rpm | |
3. verify yum repo | |
yum repolist enabled | grep "mysql.*-community.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
LOGS_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'logs') | |
LOGGING = { | |
'version': 1, | |
'dusable_existing_loggers': True, | |
'formatters': { | |
'normal': { | |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example implementation of password hasher similar to Django's PasswordHasher | |
* Requires Java8 (but should be easy to port to older JREs) | |
* Currently it would work only for pbkdf2_sha256 algorithm | |
* | |
* Django code: https://github.com/django/django/blob/1.6.5/django/contrib/auth/hashers.py#L221 | |
*/ | |
import java.nio.charset.Charset; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
import java.security.spec.KeySpec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |