Skip to content

Instantly share code, notes, and snippets.

View hzlzh's full-sized avatar
🎯
Focusing

hzlzh hzlzh

🎯
Focusing
View GitHub Profile
@hzlzh
hzlzh / gist:2237419
Created March 29, 2012 13:24
Replace text with Logo of WordPress theme Dot-B

Reply to @mynameabhay in https://twitter.com/mynameabhay/status/185343038032314370

Update those CSS style to the file: 'style.css' of Dot-B, you need to change the image link to your LOGO url, and give it a appropriate size.

'style.css' : line 64

#header #logo a, #header #logo a:visited {
color: #0066CC;
font-size: 32px;
line-height: 32px;
@hzlzh
hzlzh / gist:3089354
Created July 11, 2012 09:47
Mini Gavatar Cache
<?php
/* Mini Gavatar Cache */
/* 注:该程序中部分代码是WordPress所用,小幅修改即可复用。 */
function my_avatar( $email, $size = '50', $default = '', $alt = false ) {
$alt = (false === $alt) ? '' : esc_attr( $alt );
$f = md5( strtolower( $email ) );
$w = home_url(); //$w = get_bloginfo('url');
$a = $w. '/avatar/'. $f . '.jpg';
$e = preg_replace('/wordpress\//', '', ABSPATH) . 'avatar/' . $f . '.jpg';
$t = 604800; //设定7天, 单位:秒
@hzlzh
hzlzh / gist:3128038
Created July 17, 2012 08:31
console.log() snippet for Sublime Text 2
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>conl</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@hzlzh
hzlzh / gist:3135645
Created July 18, 2012 11:20
Js touch event for iPad
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".submit-btn").bind("touchend", function(event) {
$(this).addClass('hover')
// your fn()
$(this).removeClass('hover')
});
$(".more").bind("touchend", function(event) {
@hzlzh
hzlzh / jQuery.fn.shake.js
Created August 6, 2012 04:51
jQuery shake effect like WordPress Login Form
jQuery.fn.shake = function(intShakes, intDistance, intDuration) {
this.each(function() {
$(this).css({
position: "relative"
});
for (var x = 1; x <= intShakes; x++) {
$(this).animate({
left: (intDistance * -1)
}, (((intDuration / intShakes) / 4))).animate({
left: intDistance
@hzlzh
hzlzh / feedback-button.html
Created August 8, 2012 16:16
CSS3 Feedback Button
<div class="feedback-btn">
<a class="en-us" title="Feedback" target="_blank" href="#">Feedback</a>
<br />
<br />
<a class="zh-cn" title="用户反馈" target="_blank" href="#"> 用 户 反 馈 </a>
</div>​
@hzlzh
hzlzh / functions.php
Created August 19, 2012 15:12
Customize the WordPress Tag Cloud Widget
<?php
// the hook to custom tag widget, put in you `functions.php`
function my_tag_cloud_filter($args = array()) {
$args['smallest'] = 12; //最小字号
$args['largest'] = 12; //最大字号
$args['unit'] = 'px'; //字体单位 px,pt,em
$args['number'] = 20; //调用数量
$args['orderby'] = 'count'; //按何值排序
$args['order'] = 'RAND'; //排序方式
// for more check here: http://codex.wordpress.org/Function_Reference/wp_tag_cloud
@hzlzh
hzlzh / 匿名评论测试流程梳理.md
Created August 23, 2012 07:30
匿名评论测试流程梳理

交互相关的测试

评论框

失败情形:

0 已登录会员的流程不变
1 内容空 || 邮箱空 = [提交失败]
2 密码空 || 验证码空
3 邮箱无效 || 密码错误 = [提交失败]
4 邮箱无效 || 验证码错误 = [提交失败]

成功情形:

5 匿名选项勾选 -> [是否匿名]

@hzlzh
hzlzh / gist:3467170
Created August 25, 2012 15:36 — forked from matiaskorhonen/gist:3013808
Chrome for iOS user-agents

Chrome for iOS user-agents

iPhone

Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en-gb)
AppleWebKit/534.46.0 (KHTML, like Gecko)
CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3

@hzlzh
hzlzh / gist:3549504
Created August 31, 2012 06:01
GeekPark Feedback List

#部分反馈的整理


  1. 我觉得给视频加上字幕观看感受会好很多!希望贵公司加快节奏完成。 反馈:内容输入框无法使用中文输入(搜狗输入法),我是粘贴过来的
    :搜狗输入法的问题,应该是搜狗本身的bug,并非极客公园网站的兼容问题,参见:
    [link1] 和 [link2]

---- 2012.12.18 更新 ----

  1. 匿名用户1cuz: 我订阅了 极客公园,由于你们设置图片防盗链,导致在QQ阅读里面无法正常浏览,请设置一下白名单,谢谢。 替评论里的人反馈下
    :已解决