Skip to content

Instantly share code, notes, and snippets.

View coolicer's full-sized avatar
🎯
Focusing

e.e.p coolicer

🎯
Focusing
View GitHub Profile
@coolicer
coolicer / gist:2020975
Created March 12, 2012 09:54
HTML : Starting Template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
</body>
@coolicer
coolicer / gist:2020990
Created March 12, 2012 09:58 — forked from padolsey/gist:527683
Javascript : Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@coolicer
coolicer / gist:2042636
Created March 15, 2012 07:01
HTML : ie and NONEIE
<!DOCTYPE HTML>
<!--[if lt IE 7 ]> <html dir="ltr" class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html dir="ltr" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html dir="ltr" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html dir="ltr" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
@coolicer
coolicer / gist:2426306
Created April 20, 2012 05:30
Javascript : compatPositionFixed
//Fixed IE6 Position Fixed
(function(){
if(/MSIE 6/i.test(navigation.userAgent)) {
function compatPositionFixed(node) {
var top = 150;
node.style.position = "absolute";
node.style.top = top + document.documentElement.scrollTop + 'px';
window.attachEvent('onscroll',function(){
node.style.top = top + document.documentElement.scrollTop + 'px';
});
@coolicer
coolicer / gist:3051241
Created July 5, 2012 04:02
Javascript : Array distinct
/**
* Array distinct
* @param {Array} Array
* @return {Aaary} Return a new array without the same item
*/
var distinct = function(arr){
var i = 0,
l = arr.length,
v,t,o = {},n = [];
@coolicer
coolicer / Github
Created August 30, 2012 06:10
Github Help
--------------------------------Github Help--------------------------
0、Linux(windows跳过)
$ cd ~/.ssh //检查计算机ssh密钥
如果没有提示:No such file or directory 说明你不是第一次使用git,执行下面的操作,清理原有ssh密钥
$ ls
config id_rsa id_rsa.pub known_hosts
$ mkdir key_backup
$ cp id_rsa* key_backup
@coolicer
coolicer / favicon-interceptor.js
Created November 29, 2012 02:46 — forked from kentbrew/favicon-interceptor.js
How to short-circuit those annoying favicon requests in node.js
// early experiments with node had mysterious double requests
// turned out these were for the stoopid favicon
// here's how to short-circuit those requests
// and stop seeing 404 errors in your client console
var http = require('http');
http.createServer(function (q, r) {
// control for favicon
@coolicer
coolicer / Default (Windows).sublime-keymap
Created January 18, 2013 01:44
Sublime_text_2_key_binding
[
{ "keys": ["f12"], "command": "reindent"},
{ "keys": ["ctrl+alt+n"], "command": "new_snippet"},
{ "keys" : ["n","n"], "command": "advanced_new_file",
"context":[{"key": "setting.command_mode","operand": true}]},
{ "keys":["j","j"], "command": "exit_insert_mode",
"context":[
{ "key": "setting.command_mode", "operand": false},
{ "key": "setting.is_widget", "operand": false}
/*Reset*/
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin:0;padding:0;}body,button,input,select,textarea{font:12px/1.5 tahoma,arial,\5b8b\4f53;}
h1,h2,h3,h4,h5,h6{font-size:100%;}
address,cite,dfn,em,var{font-style:normal;}code,kbd,pre,samp{font-family:courier new,courier,monospace;}
small{font-size:12px;}
ul,ol{list-style:none;}
a{text-decoration:none;}
a:hover{text-decoration:underline;}
sup{vertical-align:text-top;}
sub{vertical-align:text-bottom;}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="http://necolas.github.com/normalize.css/1.1.0/normalize.css">
</head>
<body>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>