Skip to content

Instantly share code, notes, and snippets.

View shonenada's full-sized avatar
🤷‍♂️
Focusing

Yaoda Liu shonenada

🤷‍♂️
Focusing
View GitHub Profile
if (!isset($_SERVER['REQUEST_URI']))
{
// IIS Mod-Rewrite
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
}
// IIS Isapi_Rewrite
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
} else {
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
void* thread_function(void *arg);
int run_row = 1;
pthread_mutex_t work_mutex;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char string[1024];
} String;
typedef struct {
int size;
class LZ(object):
def __init__(self):
self.char_dict = list()
def clean(self):
self.char_dict = []
self.char_dict.append('')
def init_dict(self, string):
#include <stdio.h>
// 字符集的最大大小
#define MAX_SIZE 256
class ArithmeitcCoding {
private:
// 记录字符集合总大小
int size;
// 区间下限
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// 字典編碼
class DictionaryEncoding {
private:
// 记录字典的大小
int size;
// 字典内容
@shonenada
shonenada / .vimrc
Created August 21, 2014 04:10
.vimrc
syntax on
filetype off
" format and user interface
set nocompatible
set number
set softtabstop=4 tabstop=4 shiftwidth=4
set expandtab
set autoindent
set hlsearch
class RequestLimit:
def addRequest(self, ipp_addr, bcookie):
blkip = memcache.get('RequestLimitList')
if blkip is None:
blkip = [{
'ip_addr': ip_addr,
'bcookie': bcookie,
'count': 1,
<?php
DEFAULT_KEY = 'abcdefgh';
// $string 明文 或 密文
// $operation: decode =》 解密,其他是加密
// $key: 秘钥
// $expiry: 有效期
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
// 动态密钥长度,相同的明文会生成不同密文就是艺考动态密钥 (初始化向量 IV)
if (top != self);
if (top.location != self.location);
if (top.location != location);
if (parent.frames.length > 0);
if (window != top);
if (window.top != window.self);
if (window.self != window.top);
if (parent && parent != window);
if (parent && parent.frames && parent.frames.length > 0);
if ((self.parent && !(self.parent === self)) && (self.parent.frames.length != 0));