Skip to content

Instantly share code, notes, and snippets.

Dray DrayChou

Block or report user

Report or block DrayChou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View PHP 10进制与62进制互转,可用于生成短网址
<?php
/**
* 生成短连接的相关方法--通过记录ID换算成为58位的字符串(十进制转换成58进制)
*/
class BaseConvert {
const key_code_64 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
const key_code_58 = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
View XwCrontab.php
<?php
/**
* crontab 时间格式php解析类(PHP 5 >= 5.1.0)
*
* @author 肖武 <tsxw24@gmail.com>
* @link https://code.google.com/p/xwcrontab/
*/
class XwCrontab {
View google_drive_thumbnail.php
<?php
$file_id = "1XSE7fHxtV-etUze91fkbRKaZodDPmQx9G_6Kc8I9sPE";
$access_token = "ya29.Ci-9A9Ckkgr6hn7Uu2UdNOm8XxK20jHNu3VfDT9mV_LbR2LmCYSo4ced8DOuEZif1g";
$url = "https://drive.google.com/thumbnail?sz=w320&id=" . $file_id;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
View 其他编码的文件转为 UTF8.php
<?php
ini_set('memory_limit', '4G');
if (mb_internal_encoding() != "UTF-8") {
mb_internal_encoding("UTF-8");
}
$file = "test2.txt"; // 一个编码为gbk的中文文件
// $encodeings = mb_list_encodings();
@DrayChou
DrayChou / shadow.sh
Created Aug 25, 2016 — forked from bumaociyuan/shadow.sh
极路由安装ss
View shadow.sh
#!/bin/sh
#
echo ''
echo '/*教程请参考:极路由Shadowsocks家庭无痛翻墙实践*/'
echo 'https://luolei.org/hiwifi-shadowsocks/'
echo 'by @foru17'
echo ''
echo ''
echo '那一天,'
echo '人类终于回想起了,'
View XwCrontab.php
<?php
/**
* crontab 时间格式php解析类(PHP 5 >= 5.1.0)
*
* @author 肖武 <tsxw24@gmail.com>
* @link https://code.google.com/p/xwcrontab/
*/
class XwCrontab {
@DrayChou
DrayChou / my.cnf
Created Mar 19, 2016 — forked from jyr/my.cnf
my.cnf on MNPP
View my.cnf
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
@DrayChou
DrayChou / mysql_small.cnf
Last active Mar 21, 2016
mysql 最小配置
View mysql_small.cnf
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
View surge_main.conf
// DON'T FORGET TO IMPORT proxy.conf TOO
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
View gist:32b95a1e08df49e8f3e6

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA
You can’t perform that action at this time.