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
curl -A "Mozilla" "http://translate.google.com/translate_tts?tl=en&q=hello+world" > hello.mp3 |
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
##MySQL数据库SQL(Structured Query Language)结构化查询语言常用基本操作: | |
/*DDL(Data Definition Language)数据定义语言*/ | |
##创建数据库: | |
create database '数据库名称' charset utf8; | |
##删除数据库: | |
drop database '数据库名称'; | |
##显示所有数据库: | |
show databases; | |
##使用数据库 | |
use '数据库名称'; |
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
/*检测浏览器语言*/ | |
function get_client_language($availableLanguages, $default='en'){ | |
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { | |
$langs=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
//start going through each one | |
foreach ($langs as $value){ | |
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
/** | |
* browser sinffing | |
* http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ | |
*/ | |
(function(){ | |
var ie = (function(){ | |
var undef, | |
v = 3, | |
div = document.createElement('div'), |
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 info | |
* | |
* @return array | |
*/ | |
function parse_phpinfo() { | |
ob_start(); phpinfo(INFO_MODULES); $s = ob_get_contents(); ob_end_clean(); | |
$s = strip_tags($s, '<h2><th><td>'); | |
$s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', '<info>\1</info>', $s); | |
$s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', '<info>\1</info>', $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
// ==UserScript== | |
// @name Enable Copy | |
// @description Allow you copy-paste action on "copy-protected" website | |
// @version 1.2 | |
// ==/UserScript== | |
setInterval("document.oncontextmenu=null;document.contextmenu=null;document.ondragstart=null;document.onkeydown=null;document.onmousedown=null;document.onmousemove=null;document.onmouseup=null;document.onselectstart=null;document.selectstart=null;window.oncopy=null;document.oncopy=null;document.body.oncopy=null;document.body.onselect=null;document.body.onbeforecopy=null;document.body.contextmenu=null;document.body.oncontextmenu=null;document.body.ondragstart=null;document.body.onkeydown=null;document.body.onmousedown=null;document.body.onmousemove=null;document.body.onmouseup=null;document.body.selectstart=null;document.body.onselectstart=null;window.contextmenu=null;window.oncontextmenu=null;window.ondragstart=null;window.onkeydown=null;window.onmousedown=null;window.onmousemove=null;window.onmouseup=null;window.selectstart=null;window.onselectstart=null;window |
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
# find keywords liveperson in js file | |
find /home/wwwroot/ -type f -name "*.js" | xargs grep "liveperson" -sl | |
find /home/wwwroot/ -type f -name "*.js" -o -name "*.html" -o -name "*.htm" -o -name "*.php" | tr -d "\'"| xargs grep "liveperson" -sl |
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
# http://linux-bash.googlecode.com/files/damnp-actgod.sh | |
function check_install { | |
if [ -z "`which "$1" 2>/dev/null`" ] | |
then | |
executable=$1 | |
shift | |
while [ -n "$1" ] | |
do | |
DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes install "$1" |
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
def sanitize_at_name(name, decode = False): | |
""" Sanitize achternaam, optionally decodes | |
to unicode string from AT input """ | |
if decode: | |
name = unicode(name, 'iso-8859-15') | |
tussenvoegsels = [ | |
"af", | |
"aan", |
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 | |
""" | |
ListeningSocketHandler | |
====================== | |
A python logging handler. | |
logging.handlers.SocketHandler is a TCP Socket client that sends log | |
records to a tcp server. | |
This class is the opposite. |
OlderNewer