This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set the base image to Debian | |
# https://hub.docker.com/_/debian/ | |
FROM debian:latest | |
# replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# update the repository sources list | |
# and install dependencies | |
RUN apt-get update \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require("lodash"); | |
var R = require("ramda"); | |
var companies = [ | |
{ name: "tw", since: 1993 }, | |
{ name: "pucrs", since: 1930 }, | |
{ name: "tw br", since: 2009 } | |
]; | |
var r1 = _(companies).chain() |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
判断滚动条的需求在弹窗插件中使用比较多,当弹窗添加overflow: hidden时,如果页面比较长的话,添加这个属性之后页面会有晃动。 | |
为了增强用户体验,通过判断是否有滚动条而添加 margin-left 属性以抵消 overflow: hidden 之后的滚动条位置。 | |
判断是否有滚动条的方法 | |
function hasScrollbar() { | |
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight); | |
} | |
计算滚动条宽度的方法 | |
新建一个带有滚动条的 div 元素,通过该元素的 offsetWidth 和 clientWidth 的差值即可获得 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"xiaohongshu.com": "小红书", | |
"vip.com": "唯品会", | |
"douguo.com": "豆果美食", | |
"youshu.cc": "有书", | |
"missfresh.cn": "每日优鲜", | |
"qnr.io": "去哪儿", | |
"kaola.com": "网易考拉", | |
"waimai.meituan.com": "美团外卖", | |
"qcs.meituan.com": "美团打车", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tableToExcel Demo</title> | |
<script src="tableToExcel.js"></script> | |
</head> | |
<body> | |
<h1>tableToExcel Demo</h1> | |
<p>Exporting the W3C Example Table</p> |
title: express4.2源码解析 date: 2014-05-18 15:00:50 categories: express tags: [nodejs, node, js, express]
express是nodejs平台上一个非常流行的框架,4.2.0是最新的版本,相比3.x版本优化了代码和api,去除了connect模块,自己实现了一个router组件,实现http请求的顺序流程处理,去除了很多绑定的中间件,使代码更清晰。
##1.使用express 如何使用express在官网有很好的讲解,只用experssjs实例app的几个函数,就可以构建构建web程序。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
本文曾在“架构师之路”上发布过,近期支援Qcon-AS大会,在微信群里分享了该话题,故对原文进行重新整理与发布。 | |
一、秒杀业务为什么难做 | |
1)im系统,例如qq或者微博,每个人都读自己的数据(好友列表、群列表、个人信息); | |
2)微博系统,每个人读你关注的人的数据,一个人读多个人的数据; | |
3)秒杀系统,库存只有一份,所有人会在集中的时间读和写这些数据,多个人读一个数据。 | |
例如:小米手机每周二的秒杀,可能手机只有1万部,但瞬时进入的流量可能是几百几千万。 | |
又例如:12306抢票,票是有限的,库存一份,瞬时流量非常多,都读相同的库存。读写冲突,锁非常严重,这是秒杀业务难的地方。那我们怎么优化秒杀业务的架构呢? | |
NewerOlder