Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function() {
$('img[data^=maxsize_]').each(function(){
var size = $(this).attr('data').substring(8);
max = Math.min(this.width, this.height);
$(this).css({'width':this.width/max*size,'height':this.height/max*size});
});
});
jQuery(document).ready(function ($) {
$('.goods-detail-pic-thumbnail a').click(function(){
$('#showimage').attr('src', $(this).children('img').attr('c_src'));
<?php
class ascii
{
function decode($str) {
preg_match_all("/(\d{2,5})/", $str,$a);
$a = $a[0];
foreach ($a as $dec){
if ($dec < 128) {
$utf .= chr($dec);
} else if ($dec < 2048) {
<?PHP
//====================================================
// FileName: cache.inc.php
// Summary: update cache to file or database
// Author: millken(迷路林肯)
// LastModifed:2009-2-15
// copyright (c)2009 millken@gmail.com
//====================================================
if(!defined('OK'))exit(__FILE__.'Access Denied');
function updateConfig(){
<?PHP
//====================================================
// FileName: cache.inc.php
// Summary: update cache to file or database
// Author: millken(迷路林肯)
// LastModifed:2009-2-15
// copyright (c)2009 millken@gmail.com
//====================================================
if(!defined('OK'))exit(__FILE__.'Access Denied');
function updateConfig(){
/*
**************图片预加载插件******************
///作者:没剑(2008-06-23) http://regedit.cnblogs.com
///参数设置:
scaling 是否等比例自动缩放
width 图片最大高
height 图片最大宽
loadpic 加载中的图片路径
*/
jQuery.fn.LoadImage=function(scaling,width,height,loadpic){
修改时区
找到相应的时区文件 /usr/share/zoneinfo/Asia/Shanghai
替换当前的/etc/localtime。
修改/etc/sysconfig/clock文件的内容为:
ZONE="Asia/Shanghai"
UTC=false
< ?php
//====================================================
// FileName: webremote.php
// Summary: Web Service
// Author: millken
// LastModifed:2009-06-19 9:51
// copyright (c)2009 millken@gmail.com
//====================================================
error_reporting(7);
if ( !function_exists( "json_decode" ) )
<?php
class Scrape {
public $headers = array();
public $result;
public $error;
jQuery(function () {
if (!(typeof isStating == "undefined" || !isStating)) {
var a = $("#hd .header").eq(0).offset().left;
$(window).resize(function () {
a = $("#hd .header").eq(0).offset().left
});
$(document).mousedown(function (c) {
var d = {};
d.r = encodeURIComponent(window.location.href);
c = c || window.event;
<?php
/*
*a small MVC framework written by millken@gmail.com
*last modifed 2010-8-31 17:43
*/
if(!defined('__controller_path__'))
define('__controller_path__', dirname(__FILE__) . '/controller/');
if(!defined('__model_path__'))
define('__model_path__', dirname(__FILE__) . '/model/');
if(!defined('__config_path__'))