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 ruby | |
# Simple script to generate EPUB book (which could be also converted | |
# to MOBI then) from site sources | |
# | |
# It depends on on 'eeepub' ruby gem and also you should have | |
# ebook-convert executable somewhere in path (or use --path argument | |
# for that) | |
# | |
# Usage is simple: | |
# |
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 | |
/** | |
* nginx日志文件分析。 | |
* 根据配置的nginx日志格式,分析对应的日志内容。各变量 | |
*/ | |
class NginxLog { | |
protected static $br = "\n"; | |
/** |
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 | |
/** | |
* 感谢强大的 reactphp 。 | |
* 使用 reactphp 创建的可以限制连接数量的消息服务器 | |
* 1. 可以群发消息 | |
* 2. 可以客户端单对单发消息 | |
* 3. 可以服务器对单个客户端发送消息 | |
* usage by `composer require react/socket:^1.1` | |
**/ | |
require_once __DIR__ . '/vendor/autoload.php'; |
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 | |
if(!function_exists('my_encrypt')) { | |
function my_encrypt($data, $key) | |
{ | |
// Remove the base64 encoding from our key | |
$encryption_key = base64_decode($key); | |
// Generate an initialization vector | |
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); | |
// Encrypt the data using AES 256 encryption in CBC mode using our encryption key and initialization vector. | |
$encrypted = openssl_encrypt($data, 'aes-256-cbc', $encryption_key, 0, $iv); |
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
<style> | |
*{background: #fff} | |
</style> | |
<br> | |
<br> | |
<br> | |
<div onclick="reload()"> reload() </div> | |
<script> | |
apiready=function () { | |
alert('read'); |
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 | |
// 来源 经测试是正确的 https://blog.csdn.net/zhang197093/article/details/89061957 | |
// 增加一个crc在线校验监测网址 http://www.ip33.com/crc.html | |
/** | |
* 将一个字符按比特位进行反转 eg: 65 (01000001) --> 130(10000010) | |
* @param $char | |
* @return $char | |
*/ | |
function reverseChar($char) { |
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 | |
//include 'vendor/autoload.php'; | |
$list = glob('/Users/hainuo/Downloads/语文/*.webp'); | |
foreach ( $list as $filename){ | |
$dirname = dirname($filename); | |
$pngPath = $filename.'.png'; | |
$img = imagecreatefromwebp($filename); | |
imagepng($img,$pngPath); | |
imagedestroy($img); | |
// dump('处理完成'.basename($filename)); |
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 randomString(length, chars) { | |
var result = ''; | |
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]; | |
return result; | |
} | |
var rString = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
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
/** | |
* 电话号码识别. | |
* @author by zsc for 2010.03.24 | |
*/ | |
class gjPhone | |
{ | |
protected $imgPath; // 图片路径 | |
protected $imgSize; // 图片大小 | |
protected $hecData; // 分离后数组 |