Skip to content

Instantly share code, notes, and snippets.

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 / 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>
@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 / 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 / collapse-as-table.css
Last active December 29, 2015 17:19
Collapse border like table cell.
ul {
// align
margin-left: 1px;
}
li {
float: left;
border: 1px solid #ccc;
// container bg
background: #FFF;
@hulufei
hulufei / fixed position relative to parent.md
Last active June 26, 2018 05:37
Fixed element relative to it's parent

第一种方法

<div class="container">
  <div class="fixed">content</div>
</div>
.fixed {
@hulufei
hulufei / blur-click-event-order
Last active August 29, 2015 14:03
Blur event hidden click trigger
`click` event triggers after the `blur` so the link gets hidden. Instead of click use `mousedown` it will work.
@hulufei
hulufei / Multi-Line Ellipsis.html
Last active August 29, 2015 14:04
Multi-Line Ellipsis
<div class="ellipsis">
<div>
<p>
content text here
<i></i>
</p>
</div>
<a id="readmore" href="#">Read More</a>
</div>
@hulufei
hulufei / webpack.boilerplate.js
Last active December 28, 2015 02:36
webpack style/font/img loaders
npm i --save-dev webpack webpack-dev-server url-loader file-loader style-loader css-loader autoprefixer-loader img-loader --save-dev
@hulufei
hulufei / Antd_Steps.re
Last active July 22, 2018 05:41
Bs bind for JS object, specially for callback object arguments.
/* Bind for https://ant.design/components/steps/ */
[%bs.raw {|require("antd/lib/steps/style")|}];
type dotOptions = {
.
"index": int,
"status": string,
"title": string,
"description": string,