Skip to content

Instantly share code, notes, and snippets.

@safe1981
safe1981 / gist:1989983
Created March 7, 2012 00:08
HTML: basic html set
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
@safe1981
safe1981 / gist:1990002
Created March 7, 2012 00:11
Javascript: Self Invoking anonymous function
(function() {
})();
@safe1981
safe1981 / gist:1990062
Created March 7, 2012 00:20 — 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) {}
@safe1981
safe1981 / gist:1990077
Created March 7, 2012 00:26
Javascript: Event handler using jQuery(bind,on,live,delegate)
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>jQuery Events 201</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Click me</h2>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
@safe1981
safe1981 / init_jQuery.js
Created March 7, 2012 07:15
Javascript: jQuery초기화 기법, $표현 충돌되지 않도록
//다른 $사인과 충돌되지 않도록 jQuery초기화 기법
(function($) {
})(jQuery);
@safe1981
safe1981 / prototype.js
Created March 9, 2012 00:01
Javascript: Understanding Prototype
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript">
//생성자 함수
function Foo(y){
//특정 형태의 객체를 생성합니다.
//생성된 객체는 자신의 "y" 속성을 갖게 됩니다.
this.y = y;
}
@safe1981
safe1981 / asynchronousRecursion.js
Created March 9, 2012 13:30
Javascript: Asynchronous Recursion(jQuery)
// setTimeout 함수를 이용하여 반복적으로 함수실행시키기
(function(){
doStuff();
//arguments.callee는 자기 자신을 가리킴
//arguments.callee는 ECMAScript5 strict모드에서 depricated 되었음
setTimeout(arguments.callee,100);
})
//function에 이름주어서 해결하기
(function name(){
@safe1981
safe1981 / gist:2016608
Created March 11, 2012 14:25 — forked from paulirish/gist:1928551
draft of lazyweb-requests summary

TODO

  • defer and footnotes
  • mothereffinganimgif huge success
  • api.h5p huge success
  • big IRC client effort

12 months ago, I opened up a repo on Github; the idea was that my ideas were great and I didn't have time to complete them all, so I wrote them for other people to do. (lol) In reality, all of us have way more time than ideas, but it turned out some of the ideas I had were totally shared by other people, we just didn't have a meeting place to collaborate.

@safe1981
safe1981 / gist:2016613
Created March 11, 2012 14:28 — forked from paulirish/gist:1928551
draft of lazyweb-requests summary

TODO

  • defer and footnotes
  • mothereffinganimgif huge success
  • api.h5p huge success
  • big IRC client effort