Skip to content

Instantly share code, notes, and snippets.

View welkang's full-sized avatar

welkang welkang

View GitHub Profile
// ----------------------------------------------------------
// 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) {}
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@welkang
welkang / Browser Consistent
Created September 24, 2012 09:05
Browser Consistent
//浮动双边距
#imfloat {
float: left;
margin: 5px;/*IE下理解为10px*/
display: inline;/*IE下再理解为5px*/
}
//IE对min-height/width的支持完善
#box {
width: 80px;
height: 35px;
@welkang
welkang / clearfix
Created September 24, 2012 08:57
clear the float
/* new clearfix */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix {
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@welkang
welkang / layout.html
Created May 21, 2012 06:04
HTML:layout
<html>
<head>
<title>{block name=title}Default Page Title{/block}</title>
<meta charset="utf-8" />
<link href="/style/global.css" rel="stylesheet" type="text/css"/>
<script src="/script/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="/script/global.js"></script>
{block name=head} {/block}
</head>
{block name=body} {/block}
@welkang
welkang / SQL:INNER JION
Created May 20, 2012 16:40
SQL:INNER JOIN
SELECT title, details, task.id, name FROM tasks
INNER JION users
ON tasks.user_id = users.id;
数据库两个表的查询
@welkang
welkang / LICENSE.txt
Created February 17, 2012 15:12 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE