Skip to content

Instantly share code, notes, and snippets.

@yisibl
yisibl / HTML-tags.md
Last active September 15, 2024 14:09
常用的 HTML 头部标签

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)
@jinlong
jinlong / jsProbability.js
Last active November 24, 2016 08:28
javascript Math.random() 写了个概率函数(项目中要用,记录一下)
//probability : 0.6(60%)
var getRandom = function(probability){
var probability = probability*10 || 1;
var odds = Math.floor(Math.random()*10);
if(probability === 1){return 1};
if(odds < probability){
return 1;
}else{
return 0;
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//