Skip to content

Instantly share code, notes, and snippets.

Avatar

Constantine Kim 김현진 elegantcoder

View GitHub Profile
@elegantcoder
elegantcoder / label-ui-like-placeholder-pw.html
Created Jul 14, 2012
입력 필드 내에 텍스트 표시 UI 의 예제 코드
View label-ui-like-placeholder-pw.html
<label for="ex1-pw-input" style="display:none;">비밀번호</label>
<input type="password" value="비밀번호" data-placeholder="비밀번호" id="ex1-pw-input" />
View collection-reset-event-handler-arguments.coffee
fCollection.on 'reset', (collection, opts) ->
# contents of opts
# {
# error: function (model, resp) {}
# parse: true
# success: function (resp, status, xhr) {}
# }
View .htaccess
# +Includes 를 넣었습니다. 이것은 httpd.conf 에서 <Directory> 설정을 상속받아 Includes를 추가해주어야 하므로
# Options Includes 가 아니라  Options +Includes 입니다.
# .htaccess 를 사용하려면 <Directory> 에서 AllowOverride All 로 설정하세요.
AddOutputFilter INCLUDES .html
Options +Includes
View README.md

NOT Clear Things Across Browsers

  • 브라우저 별로 애매한 Front-end 코드 모음.
@elegantcoder
elegantcoder / README.md
Created Sep 2, 2012
Most Common Regexp
View README.md
View Template.coffee
# BackboneJS 에 의존하는 템플릿 클래스.
# XML 로 로드해 템플리팅해서 리턴함
# depends on backbone(Backbone.Event), jQuery(Ajax calling), underscore(Template engine)
root = root ? this
class root.Template
# 템플릿 XML 파일 로드 완료여부
@ready = false
constructor: (@options = {templateURL: ''}) ->
@rawContents = ''
@elegantcoder
elegantcoder / README.md
Created Sep 21, 2012
JS Util Functions
View README.md

JS Util Functions

View code.html
<!--#config timefmt="%s" --> <!-- 시간을 읽는 방법을 Unix Timestamp 로 설정 -->
<link href="/css/styles.css?<!--#flastmod virtual="/css/styles.css" -->" rel="stylesheet" type="text/css" /> <!-- last modified 타임을 GET 파라미터로 넘김 -->
<script type="text/javascript" src="/js/vendor/vendors.min.js?<!--#flastmod virtual="/js/vendor/vendors.min.js" -->"></script>
<script type="text/javascript" src="/js/app/common.min.js?<!--#flastmod virtual="/js/app/common.min.js" -->"></script>
View backbone-event-logger.coffee
_.each(_.functions(Backbone.Events), (functionName) ->
Backbone.Events[functionName] = _.wrap(Backbone.Events[functionName], (fun) ->
args = _.toArray(arguments).slice(1)
console.log.call console, _.flatten([functionName, args])
console.trace()
fun.apply(this, args)
)
)
_.extend Backbone, Backbone.Events
View install_chef.sh
echo "deb http://apt.opscode.com/ precise-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
sudo mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
sudo apt-get -y update
sudo apt-get -y install opscode-keyring
sudo apt-get -y upgrade
sudo apt-get -y install chef