- 각 html엘리먼트명에 대응하는 함수는 String, Array, Object의 3가지 형태의 파라메터를 받을 수 있다. 모든 파라메터를 생략 가능하고 순서는 상관 없다.
- String형은 innerHTML에 대응
- Object형은 attributes에 대응
- Array형은 child elements에 대응, Array의 요소로써 String은 textNode에 대응
- 템플릿처럼 사용하기 위해 $로 시작하는 변수를 context변수로 사용한다.
| #flashContent { | |
| width: expression(document.body.clientWidth > 1080 ? '100%' : '1080px'); | |
| overflow: expression(document.body.clientWidth > 1080 ? 'hidden' : 'auto'); | |
| } | |
| @media screen and (min-width: 1080px) { | |
| #flashContent { | |
| width: 100%; | |
| overflow: hidden; | |
| } |
| <?php | |
| namespace webapp; | |
| /** | |
| * base Doctrine entity for convinent orm association | |
| */ | |
| class BaseEntity | |
| { | |
| protected $_properties; |
| <?php | |
| /** | |
| * @Entity | |
| * @Form(method="POST") | |
| */ | |
| class Article | |
| { | |
| /** @Id @GeneratedValue @Column(type="integer") */ | |
| private $id; |
| <? | |
| class Response | |
| { | |
| private $headers = array(); | |
| private $body = ''; | |
| function __construct($body='', $headers=array()) | |
| { | |
| $this->body = $body; | |
| $this->headers = array_merge($this->headers, $headers); |
| <?php | |
| class DBStorageStream | |
| { | |
| const DDL = <<<EOF | |
| CREATE TABLE IF NOT EXISTS `table_dbfs` ( | |
| `path` VARCHAR(255) NOT NULL PRIMARY KEY, | |
| `data` LONGTEXT, | |
| `is_dir` CHAR(1) NOT NULL DEFAULT 'N', | |
| `created_at` DATETIME, |
| #!/bin/sh | |
| # init git repository with "git init" command | |
| # minecraft server is running on screen named "mc" | |
| # ^M means newline character. type c-V-M in your editor | |
| # put this file in your minecraft server's directory | |
| # edit crontab with "crontab -e" and add this line: | |
| # 0 12 * * * /path/to/minecraft/backup.sh > /dev/null 2>&1 | |
| CWD=$(readlink -f `dirname $0`) | |
| screen -S mc -X stuff "say [Backup] Server goes readonly in 10 seconds^M" |
| import json | |
| from functools import wraps | |
| from flask import render_template, url_for, request, redirect, session | |
| from flask import Response | |
| def require_role(role='student'): | |
| def decorate(f): | |
| @wraps(f) | |
| def check(*args, **kwargs): | |
| if session.get('role') != role: |
| jQuery(function() { | |
| jQuery.support.placeholder = 'placeholder' in document.createElement('input'); | |
| if (jQuery.support.placeholder) return; | |
| var isEmpty = function(el) { | |
| return el.val().length === 0 || el.val() == el.attr('placeholder'); | |
| }, | |
| hold = function(el) { | |
| if (isEmpty(el)) { | |
| var e = el.get(0); |
| ;(function($){ | |
| // append vml xmlns to document | |
| if ($.browser.msie && document.namespaces["v"] == null) { | |
| document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); | |
| var ss = document.createStyleSheet().owningElement; | |
| ss.styleSheet.cssText = "v\\:*{behavior:url(#default#VML);}" | |
| } | |
| var getHTML = function(o) { | |
| return '<div class="ie_border_radius" style="position: absolute; left: 0px; top: 0px; z-index: -1; width:' + |