This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* fibonacci() { | |
let prev = 0; | |
let curr = 1; | |
yield prev; | |
yield curr; | |
while(true) { | |
let temp =prev; | |
prev = curr; | |
curr = temp + curr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.*[가-힣]+.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.methods({ | |
regUser : function(info){ | |
console.log(info); | |
//1 | |
Accounts.createUser(info); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
폼을 초기 로딩상태로 회복시키는 방법은 2가지 방법이 있음. | |
1. 자바스크립트로 programatic하게 form 자체의 dom메소드를 활용하는 방법 | |
$('#reset')[0].reset(); | |
2. DOM에 선언 reset type의 input 태그를 선언하는 방법 | |
<input id="reset" type="reset" value="리셋" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="jquery-ui-1.11.1.custom/external/jquery/jquery.js"></script> | |
<script src="jquery-ui-1.11.1.custom/jquery-ui.js"></script> | |
<script> | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by cinos81 on 2014. 10. 4.. | |
*/ | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.sendfile('index.html'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//클래스명을 통해 접근 가능. | |
ClassName.class.getResource("").getPath(); | |
//클래스 인스턴스 내에서 다음처럼 접근하는 것 또한 가능 | |
this.getClass().getResource("").getPath(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'cinos81' | |
if __name__ == '__main__': | |
testList = [{'a': 1, 'b': 2}, {'a': 'a', 'b': 'b'}] | |
print testList | |
subsetList = [{key: value for key,value in record.items() if key == 'a'} for record in testList] | |
print subsetList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'artemr' | |
''' | |
왜 파이썬 데코레이터를 만들때, @wraps어노테이션을 쓰는 것을 권장하는 걸까? | |
이유인 즉슨, 데코레이터 내부에서 인자로 전달받은 함수가 익명함수 처럼 취급되어 버리므로 디버깅이 난해해지는 단점이 있었기 때문이다. | |
자세한 설명은 아래의 링크에 첨부되어 있다. | |
원본: http://artemrudenko.wordpress.com/2013/04/15/python-why-you-need-to-use-wraps-with-decorators/ | |
사본: https://www.evernote.com/shard/s174/sh/78eaad5f-a8f2-4496-b984-e3385fb963c0/922d9ab4b5cd23ac7b85aab42536aa4f | |
''' | |