Skip to content

Instantly share code, notes, and snippets.

View horsley's full-sized avatar

Horsley Lee horsley

View GitHub Profile
@horsley
horsley / main.go
Created April 22, 2014 05:14
文件分割器 for jingboli
// ljbSpilter project main.go
package main
import (
"bufio"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
@horsley
horsley / PHPFetionEx.php
Created October 18, 2012 05:54
PHP Fetion Sms Sender
<?php
/**
* PHP飞信发送类-增强版
*
* 本项目基于quanhengzhuang在google code上面的项目php-fetion
* 基于php-fetion版本1.2.1
*
* @author horsley <i@a-li.me>
* @version 1.1.0
*/
@horsley
horsley / template.class.php
Created October 29, 2012 16:28
PHP Simple Template Engine
<?php
//模板文件路径定义
if (!defined('TPL_ROOT_PATH')) define('TPL_ROOT_PATH', dirname(__FILE__).'/tpl');
class Template {
private $_data = array();
private $_tpl_name;
function __construct($tpl_name = '') {
@horsley
horsley / lnmp_conf_patch.php
Created December 30, 2012 09:17
lnmp的设置补丁以适应awstats日志统计, 在服务器上chmod +x 之后即可以运行,修改的文件均会被备份
#!/usr/bin/php
<?php
/**
* lnmp的设置补丁以适应awstats日志统计
* @author: horsley <imhorsley@qq.com>
*
* 可用于lnmp和lnmpa,已在0.8和0.9版本上面测试过,默认状态的日志格式有误,少了双引号
*/
error_reporting(E_ALL);
//虚拟主机脚本
@horsley
horsley / Translation.class.php
Created January 5, 2013 12:46
simple translation class, use json to store terms pair
<?php
/**
* Created by JetBrains PhpStorm.
* User: horsley
* Date: 12-12-16
* Time: 下午10:19
* To change this template use File | Settings | File Templates.
*/
if (!defined("TRAN_DICT_PATH")) define("TRAN_DICT_PATH", dirname(dirname(__FILE__)) . '/data/translations.json');
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
@horsley
horsley / vps_status.php
Last active December 12, 2015 05:19
A simple PHP script to get vps's status from solus api
<?php
/**
* A simple PHP script to get vps's status from solus api
*
*/
set_time_limit(180);
$serv_array = array(
array(//an vps
'api_server' => 'https://solus.hostigation.com:5656', //panel login page
@horsley
horsley / awstats_trigger.php
Created February 6, 2013 16:50
multi configs's awstats update script
#!/usr/bin/php
<?php
/**
* Created by JetBrains PhpStorm.
* User: horsley
* Date: 13-1-30
* Time: 上午1:00
* To change this template use File | Settings | File Templates.
*
* cron -e and add this file , remember chmod + x
@horsley
horsley / jnulib.php
Created March 26, 2013 17:28
暨南大学图书馆搜书接口
<?php
/**
* Created by JetBrains PhpStorm.
* User: Horsley
* Date: 12-4-30
* Time: 下午3:47
* To change this template use File | Settings | File Templates.
*/
$act = $_GET['action'];
switch($act){
<?php
/**
* @author Anush Prem <goku.anush@gmail.com>
* @package Solver
* @subpackage Sudoku
* @version 0.1
*/
/**