Skip to content

Instantly share code, notes, and snippets.

View hoosin's full-sized avatar
🦍
在这个男神女神遍地的年代,我只是一个男兽。

XIN HU hoosin

🦍
在这个男神女神遍地的年代,我只是一个男兽。
  • China
  • 06:49 (UTC +08:00)
View GitHub Profile
@hoosin
hoosin / index
Created May 8, 2014 06:17
IE67中li浮动外边距无法撑开ul的解决方法
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div class="wrap">
<ul class="q">
<li></li>
<li></li>
@hoosin
hoosin / JavaScript.js
Last active August 29, 2015 14:01
this me
var me=[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[
@hoosin
hoosin / index.html
Last active August 29, 2015 14:01
通过CSS实现GitHub的Loading效果
<div class="loading-msg">
数据加载中请稍后
<div class="loading-box">
<div class="loading" index="0"></div>
<div class="loading" index="1"></div>
<div class="loading" index="2"></div>
<div class="loading" index="3"></div>
<div class="loading" index="4"></div>
</div>
</div>
@hoosin
hoosin / js.js
Last active August 29, 2015 14:01
parseInt()
console.log(parseInt("10")) //10
console.log(parseInt("010")) //10
console.log(parseInt("19", 10)) //19
console.log(parseInt("11", 2)) //3
console.log(parseInt("17", 8)) //15
console.log(parseInt("1f", 16)) //31
console.log(parseInt("He was 40")) //Nan
@hoosin
hoosin / gist:234caa1f32985ea82550
Last active March 14, 2016 10:44
toUpperCase
function numToChar(str) {
var chartArr = str.split("");
var chartLib = {
a: 1,
b: 2,
c: 3,
d: 4,
e: 5,
f: 6,
g: 7,
<!DOCTYPE html>
<head>
<style type="text/css">
*{ padding:0px; margin:0px;}
.box{ width:1000px; background:#ccc; margin:0 auto; overflow:hidden; margin-bottom:20px;}
.main{ width:770px; height:2000px; background:#000; float:left;}
.sub{ width:220px; background:#FC6; float:right;}
.sub01{ width:220px; height:100px; background:#0CC; margin-bottom:10px;}
@hoosin
hoosin / tree.html
Created November 6, 2014 06:26
圣诞树js版本
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>圣诞树</title>
<style type="text/css">
#innter{text-align: center;}
</style>
</head>
<body>
@hoosin
hoosin / getNow.js
Created November 11, 2014 02:39
getNow 模拟本地时间
var getNow = (function () {
//DEBUG 为false则返回真实时间,ture 则返回模拟时间。
var DEBUG = true;
//通过修改年、月、日 时 分 秒 毫秒 来达到某个时间的模拟。
var now = new Date(2014, 10, 24, 0, 0, 0, 0).getTime();
var begin = new Date();
return function () {
if (DEBUG) {
var t = new Date().getTime();
now += t - begin;
function func() {
var i = 0;
return function () {

return i++;
}
}
var counter = func();
console.log(counter()); // 0
console.log(counter()); // 1
// 原生JavaScript获取复选框的值
function get_checkbox_value(field){
if(field&&field.length){
for(var i=0;i<field.length;i++){
if(field[i].checked && !field[i].disabled){
return field[i].value;
}
}
}else {
return;