Skip to content

Instantly share code, notes, and snippets.

View huanle0610's full-sized avatar
🎯
Focusing

huanle0610 huanle0610

🎯
Focusing
  • Shenzhen, China
View GitHub Profile
@huanle0610
huanle0610 / bartik2.info
Last active December 17, 2015 12:09
基于Bartik创建子主题 bartik2.info
name = Bartik2
description = A flexible, recolorable theme with many regions.
core = 7.x
;定义父主题
base theme = bartik
;添加新样式表
stylesheets[all][] = css/bartik2.css
;覆盖样式, 不创建此文件或为空白文件 则意义同于 禁用该样式表
stylesheets[all][] = css/style.css
@huanle0610
huanle0610 / img.php
Created January 13, 2014 07:56
//Base64 image data to image file
<?php
//Base64 image data to image file
$a = array("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAP//AAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADwATADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD2+iiimIKKKKADvRRRQAUUUUAFFHWigAooooAOlFFFABRR2ooAKKKKACig0UAFFFFABRRRQAUUd6O9ABRRS0AJRRRQAUUUUAHeiiigAooo7UAFFFFABRRRQ
@huanle0610
huanle0610 / calc.html
Created April 2, 2014 03:35
Extjs4 calc
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>计算器-Ext4js</title>
<script src="http://cdn.sencha.com/ext/gpl/4.2.1/ext-all.js"></script>
<link rel="stylesheet" href="http://cdn.sencha.com/ext/gpl/4.2.1/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css">
<style>
table{margin:20px 0 0 20px;font-size:20px;line-height:40px;border:1px solid #000;padding:3px;}
th{text-align:center;}
<VirtualHost *:80>
ServerName codec.cc
DocumentRoot "E:\phpdemo\codec2i"
<Directory "E:\phpdemo\codec2i">
Options FollowSymLinks
IndexOptions Charset=utf-8
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@huanle0610
huanle0610 / progressbar.html
Created September 11, 2014 02:04
Extjs4.2 Progressbar Multi-segment
<html>
<head>
<meta charset="UTF-8">
<title>Extjs4.2 Progressbar Multi-segment</title>
<link rel="stylesheet"
href="http://cdn.sencha.com/ext/gpl/4.2.0/resources/ext-theme-neptune/ext-theme-neptune-all.css"/>
<script src="http://cdn.sencha.com/ext/gpl/4.2.1/ext-all.js"></script>
<script src="http://cdn.sencha.com/ext/gpl/4.2.1/ext-theme-neptune.js"></script>
<style type="text/css">
#pb{
var now = new Date();
var monthnumber = now.getMonth();
var yearnumber = now.getFullYear();
var count = 0;
var months = new Array(13);
months[0] = "Jan";
months[1] = "Feb";
months[2] = "Mar";
months[3] = "Apr";
@huanle0610
huanle0610 / url_unique.php
Created October 7, 2015 12:52
format after parse the nginx log
<?php
$str = file_get_contents('C:\Users\huanle0610.HL-PC\Desktop\hk.json');
$arr = json_decode($str, 1);
var_dump($arr['items'][0]);
$list =array();
foreach($arr['items'] as $row)
{
$list[] = sprintf('%s %s %s', $row['method'], $row['url'], $row['protocol']);
}
@huanle0610
huanle0610 / parse_nginx_log.php
Created October 7, 2015 12:57
parse nginx log to get primary script unknow requests
<?php
$file = '/var/log/nginx/YOURDOMAIN.error.log';
$fd = fopen ($file, "r");
while (!feof ($fd))
{
$buffer = fgets($fd, 4096);
$lines[] = $buffer;
}
fclose ($fd);
var_dump(count($lines));
@huanle0610
huanle0610 / phprbac_plantuml.php
Created April 24, 2016 23:17
Show phprbac permissions and roles in PlantUML
<?php
require_once 'autoload.php';
require_once 'src/PhpRbac/Rbac.php';
$rbac = new \PhpRbac\Rbac();
function getPermissionUml(&$rbac)
{
$arr = Jf::sql('select * from phprbac_permissions');
echo "title Permissions", "\n";
foreach($arr as $row)
Ext.Loader.loadScript({
url: ['resources/codemirror-5.26.0/lib/codemirror.js', 'resources/codemirror-5.26.0/lib/codemirror.css'],
onLoad: function () {
console.log('load ok', arguments);
},
onError: function () {
console.error('load error', arguments);
}
});