Stack Overflow - Why does Python print unicode characters when the default encoding is ASCII?
This file contains hidden or 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
package main | |
import ( | |
"context" | |
"crypto/sha256" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net" | |
"net/http" |
This file contains hidden or 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 | |
namespace Common; | |
/** | |
* 可加密解密的base32 | |
* | |
* @author ForthXu | |
*/ | |
class base32 { |
This file contains hidden or 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 Emt = (function() { | |
var env = {}, | |
navigator = window.navigator, | |
userAgent = navigator.userAgent, | |
ios = userAgent.match(/(iPad|iPhone|iPod)[^;]*;.+OS\s([\d_\.]+)/), | |
android = userAgent.match(/(Android)\s([\d\.]+)/); | |
env.isAndroid = (/android/gi).test(navigator.appVersion); | |
env.isIDevice = (/iphone|ipad|ipod/gi).test(navigator.appVersion); | |
env.isWebkit = /WebKit\/[\d.]+/i.test(userAgent); | |
env.isSafari = ios ? (navigator.standalone ? env.isWebkit : (/Safari/i.test(userAgent) && !/CriOS/i.test(userAgent) && !/MQQBrowser/i.test(userAgent))) : false; |
This file contains hidden or 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/python | |
# -*- coding:utf-8 -*- | |
# Orignal Author: FrankHacker | |
# Modified by Linson @691000737 | |
# Require requests module, python3.x+ | |
# 处理常见违禁词,全站扫描,违禁词可以从自己的网站导出成json格式,替换13行内容 | |
# 程序会在当前目录生成badword.txt文件 | |
import requests | |
import re,json |
This file contains hidden or 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
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
This file contains hidden or 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 | |
//http://blog.codinglabs.org/articles/write-daemon-with-php.html | |
//Accpet the http client request and generate response content. | |
//As a demo, this function just send "PHP HTTP Server" to client. | |
function handle_http_request($address, $port) | |
{ | |
$max_backlog = 16; | |
$res_content = "HTTP/1.1 200 OK | |
Content-Length: 15 | |
Content-Type: text/plain; charset=UTF-8 |
This file contains hidden or 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/python2.7 | |
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import urllib2 | |
import time | |
import csv | |
import sys,os | |
import pymysql | |
def get_cur_file_dir(): |
This file contains hidden or 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
#include < stdio.h > | |
#include < time.h > | |
void init_daemon(void);//守护进程初始化函数 | |
/** | |
* 编译:gcc -g -o daemon init.c daemon.c | |
* 执行:./daemon | |
* 查看进程:ps -ef | grep daemon | |
*/ |