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: UTF-8 -*- | |
# !/usr/bin/python | |
# read content from the html file | |
file = open('/Users/marco/PycharmProjects/StyleReplace/wechat.html' ,'r') | |
str = file.read() | |
# replace head 2 label | |
h2Start = '''<p style="line-height: 25.6px; max-width: 100%; min-height: 1em; white-space: pre-wrap; color: rgb(62, 62, 62); background-color: rgb(255, 255, 255); box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; color: rgb(41, 148, 128); line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important;"></strong></p> | |
<p style="max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;"><strong style="max-width: 100%; color: rgb(41, 148, 128); line-height: 25.6px; box-sizing: border-box !important; word-wrap: break-word !important;"><span style="max-width: 100%; font-size: 24px; box-sizing: border-box !important; word-wrap: break-word !important;"> '''; |
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 | |
from collections import namedtuple | |
disk_ntuple = namedtuple('partition', 'device mountpoint fstype') | |
usage_ntuple = namedtuple('usage', 'total used free percent') | |
def disk_partitions(all=False): | |
"""Return all mountd partitions as a nameduple. | |
If all == False return phyisical partitions only. | |
""" |
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 | |
yum groupinstall 'Development tools' -y | |
yum install ncurses ncurses-devel wget git -y | |
cd /usr/local/src | |
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 | |
tar -xjf vim-7.4.tar.bz2 | |
cd vim74 | |
./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp | |
make && make install |
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
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
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
#!/usr/bin/env python | |
import sys | |
if __name__ == '__main__' and len(sys.argv) > 5 and sys.argv[1][-3:].upper() == 'PDF': | |
original = sys.argv[1] | |
target = original[:-4] + '.cropped.pdf' | |
left = int(sys.argv[2]) | |
top = int(sys.argv[3]) | |
right = int(sys.argv[4]) |
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
var Job = { | |
data : [ | |
"We are glad to see you here. This site is dedicated to", | |
"poetry and to the people who make poetry possible", | |
"poets and their readers. FamousPoetsAndPoems.com is", | |
"a free poetry site. On our site you can find a large", | |
"collection of poems and quotes from over 631 poets", | |
"Read and Enjoy Poetry", | |
"I, too, sing America", |