Skip to content

Instantly share code, notes, and snippets.

@hulufei
hulufei / html5boilerplate.jade
Last active December 25, 2015 16:19 — forked from xtian/html5boilerplate.jade
HTML5 Boilerplate in jade
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
//[if gt IE 8]><!
html(class='no-js')
//<![endif]
@hulufei
hulufei / sinon-test-example.js
Last active December 25, 2015 04:09
A typical SinonJS test example, include stub, Ajax test, fakeTimer etc.
/*global describe, beforeEach, afterEach, it */
'use strict';
(function () {
describe('Phone Message Validator Plugin', function () {
beforeEach(function() {
var fixture = [
'<form method="post" action=".">',
'<button>Get Verify Code</button>',
'<span class="message hide">message sent, wait <span class="countdown"></span>',
'<input class="code" type="text"/>',
@hulufei
hulufei / vertical-align.html
Created September 27, 2013 02:39
Review vertical-align
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Review vertical-align</title>
<style>
.icon-x { display: inline-block; width: 50px; height: 50px; vertical-align:middle; }
</style>
</head>
<body>
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@hulufei
hulufei / tips.js
Created June 26, 2013 09:07
General tips for javascript
// prevent repeat animation
$('#demo').stop().animate({...});
@hulufei
hulufei / helper.css
Created June 6, 2013 10:35
helper css collection
/**
* @see http://goo.gl/meG1Z
*/
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
/**

Demo

表格 - Table

收货人
订单类型 订单号
@hulufei
hulufei / slide.html
Last active December 15, 2015 23:50
slide demo
<!--
better name: wrapper -> roll
-->
<div class="slides">
<div class="wrapper">
<div class="slide">
<img src="images/order-1.jpg" alt="" class="thumb" />
</div>
<div class="slide">
<img src="images/order-2.jpg" alt="" class="thumb" />
@hulufei
hulufei / css-triangle.styl
Last active December 15, 2015 22:49
CSS triangle with specific filled color
/**
* From twitter bootstrap
*/
popoverArrowOuterWidth = 10px
popoverArrowWidth = 9px
popoverArrowOuterColor = #CCC
popoverArrowColor = #FFF
.popover
position: absolute
@hulufei
hulufei / custom-radio.scss
Last active December 15, 2015 22:39
Custom Radio button background image
/**
* fall back in IE < 9
* Set background alone if using Compass's css sprites, or IE8 will fail
* all background-image styles, for it doesn't support :checked
*/
input[type="radio"] {
display: none;
}
input[type="radio"] + label {
padding-left: 15px;