Skip to content

Instantly share code, notes, and snippets.

View Go7hic's full-sized avatar
👓
👖

Go7hic Go7hic

👓
👖
View GitHub Profile
@Go7hic
Go7hic / CSStx.html
Last active February 7, 2017 01:56
CSS 画的头像 #tags: cssdemo
<h1>cssfaces.com</h1>
<!--class .demo just for this demo-->
<div class="demo">
<span class="hair"></span>
<header>
<span class="eyes"></span>
<span class="nose"></span>
<span class="accessoire"></span>
</header>
</div>
@Go7hic
Go7hic / HTML-tags.md
Last active February 7, 2017 01:57 — forked from yisibl/HTML-tags.md
常用的 HTML 头部标签 #tags: 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 -->
@Go7hic
Go7hic / js自动轮播效果
Last active June 14, 2016 11:18
7-1 js自动轮播效果
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js图片轮播</title>
<style>
body,div,ul,li{margin:0;padding:0;}
ul{list-style-type:none;}
body{background:#000;text-align:center;font:12px/20px Arial;}
#box{position:relative;width:492px;height:172px;background:#fff;border-radius:5px;border:8px solid #fff;margin:10px auto;cursor:pointer;}
@Go7hic
Go7hic / Javascript排序算法
Created May 8, 2014 15:26
Javascript排序算法
// JS排序算法
var Sort = {}
Sort.prototype = {
// 利用sort进行排序
systemSort:function(array){
return array.sort(function(a, b){
return a - b;
});
},
@Go7hic
Go7hic / gist:169685f6d66b3bc10f4e
Last active August 5, 2018 05:58
canvas做的背景
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>背景</title>
<style>
* {
margin: 0;
padding: 0;
}
// Sort Numbers
function solution(nums){
return (nums || []).sort(function(a, b){
return a - b
});
}
// -------------------------------------------------------------------------------------------------------------------------
// If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
var obj = {
value = 1,
increment: function() {
this.value += 1;
return this;
},
add: function (v) {
this.value += v;
return this
},
@Go7hic
Go7hic / jspattern.js
Last active February 7, 2017 03:41
JS 设计模式 #tags: 设计模式
// 策略模式
var validator = {
types: {},
messages: [],
config: {},
validate: function (data) {
@Go7hic
Go7hic / checkie.js
Last active February 7, 2017 03:29
判断ie浏览器 #tags: IE
//ie9-
var isIE9_ = document.all && !window.atob;
// ie8-
var isIE8_ = document.all && !document.addEventListener;
var isIE8_ = '\v'=='v';
var isIE8_ = !+'\v1';
// ie7-
@Go7hic
Go7hic / what-forces-layout.md
Created June 13, 2016 01:39 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()