Skip to content

Instantly share code, notes, and snippets.

View garveen's full-sized avatar

Garveen garveen

  • Guangzhou, China
View GitHub Profile
<?php
$source = './a';
$desc = './b';
$words = array(
'and' => 1,
'__LINE__' => 1,
'class' => 1,
'die' => 1,
'empty' => 1,
@garveen
garveen / bigfileUpload.php
Last active April 4, 2022 17:56
using html 5 APIs, slice big file into blob and upload
<?php
/*
you may modify:
php:
filename
file max size
buf size
how long to wait
@garveen
garveen / loop&timer.lua
Last active October 6, 2015 11:27
2 function Logitech script
-- 罗技脚本示例
-- 此脚本被本人用于弱智核电
-- 国服 慕容行者#5979
-- 启动键编号
startButton = 7;
-- 结束键编号,必须小于等于5,否则有可能报错
endButton = 4;
@garveen
garveen / 12306.js
Created January 6, 2016 14:59
防止12306老是断,2016年春季版
$(document).ajaxComplete(function(e, xhr, settings) {
if (!$('#queryLeftTable').children().length) {
window.setTimeout(function() {
if (!$('#queryLeftTable').children().length) {
window.setTimeout(function() {
$('#query_ticket').click();
window.setTimeout(function() {
$('#query_ticket').click();
}, 500);
}, 500);
<?php
class Map
{
const TREE = 0x1;
const GRESS = 0x2;
const BRIDGE = 0x4;
const BLOCKED = 0x8;
protected $size_x;
<?php
class Base
{
private $called = false;
public function save()
{
if ($this->called) {
throw new Exception("should be only called once!", 1);
}