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 | |
# -*- coding: utf-8 -*- | |
import mechanize | |
from colorama import init | |
from colorama import Fore, Back, Style | |
init() | |
def main(): |
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
l = []; | |
l.push('<body>'); | |
if ($.a > $.b) { | |
l.push('a > b'); | |
}else{ | |
l.push('a < b'); | |
} | |
l.push('</body>'); |
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
git archive -o update.zip HEAD $(git diff --name-only HEAD^) |
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
run: | |
sed 's/"\([[:alnum:]]*\),\([[:alnum:]]*\)"/"\1:\2"/g' data/yo.csv > data/yo.sed.csv | |
test: | |
@echo "a,b,c,d,e,\"a,b\",f,g,\"h,i\",j,k\n1,2,3,4,5,\"6,7\",8,9,\"10,11\",12,13" | \ | |
sed 's/"\([[:alnum:]]*\),\([[:alnum:]]*\)"/"\1:\2"/g' |
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
<?php | |
$check = isset($_POST['check']) ? $_POST['check'] : array(); | |
$types = array( | |
1 => '報紙', | |
2 => '雜誌', | |
3 => '其他' | |
); | |
echo '<h3>',"Checked:",'</h3>'; |
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 | |
LOAD=$(awk '{print $1}' /proc/loadavg) | |
if [ $(echo "$LOAD > 100" | bc) = 1 ]; then | |
/etc/init.d/php-fpm restart | |
fi |
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
from mailer import Message, Mailer | |
m = Message() | |
m.From=“Name <[email protected]>" | |
m.To=“[email protected]" | |
m.BCC=[‘[email protected]’,’[email protected]'] | |
m.Subject='Hello world testing' | |
m.charset="UTF-8" | |
m.Html = "Testing some things!” |
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/sh | |
NGINX=/usr/local/nginx/sbin/nginx | |
CONFIG=/usr/local/nginx/conf/nginx.conf | |
DESC=nginx | |
COLOR_RESET="\033[0m" | |
COLOR_GREEN="\033[32m" | |
COLOR_RED="\033[31m" |
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/sh | |
PREFIX=/usr/local/php | |
PHP_FPM_BIN=${PREFIX}/sbin/php-fpm | |
PHP_FPM_CONF=${PREFIX}/etc/php-fpm.user.conf | |
PHP_FPM_PID=${PREFIX}/pid/php-fpm.user.pid | |
PHP_OPTIONS="--fpm-config $PHP_FPM_CONF" |
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 | |
PREFIX=/usr/local/mysql | |
MYSQL_CONFIG=${PREFIX}/my.cnf | |
MYSQL_PORT=3306 | |
MYSQL_USERNAME="root" | |
MYSQL_PASSWORD="password" | |
MYSQLD_SAFE=${PREFIX}/bin/mysqld_safe |