Skip to content

Instantly share code, notes, and snippets.

@romeoh
romeoh / gist:5640790
Created May 24, 2013 01:50
GAE 구글계정 사용하기.
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
user = users.get_current_user()
if user:
self.response.headers['Content-Type'] = 'text/plain'
@romeoh
romeoh / gist:5352852
Created April 10, 2013 08:32
터미널 삭제.
sudo find . -type d -name .svn -depth -exec rm -rf {} \;
@romeoh
romeoh / gist:5350983
Created April 10, 2013 01:19
clipboard
<!DOCTYPE HTML>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi">
<title>sample</title>
<style type="text/css">
input {width:300px}
var romeoh = {}
romeoh.webdb = {}
romeoh.webdb.db = null
romeoh.webdb.open = function() {
var dbSize = 5 * 1024 * 1024; // 5MB
romeoh.webdb.db = openDatabase("test", "1.0", "Todo manager", dbSize);
}
romeoh.webdb.onError = function(tx, e) {
<script defer>
function gate(fn, number_of_calls_before_opening) {
console.log(arguments.callee)
return function() {
arguments.callee._call_count = (arguments.callee._call_count || 0) + 1;
if (arguments.callee._call_count >= number_of_calls_before_opening)
fn.apply(null, arguments);
};
}
var f = gate(function(arg) {
document.querySelector('#ele').style['webkitTransform'] = 'translate3d(100px,0,0)';
@romeoh
romeoh / mpui.js
Last active December 14, 2015 07:59
css, animate, drag -webkit-transform:translateX, translateY으로 작동 테스트 버전.
/********************************************
* mpui.js
* morpheus UI Framework
* Author : 백국경 ([email protected])
* Copyright © 2013 Uracle Co., Ltd.
* 166 Samseong-dong, Gangnam-gu, Seoul, 135-090, Korea All Rights Reserved.
* 베타버전입니다. 버그는 [email protected]로 보고해주세요.
*******************************************/
(function(g, d, w, undefined) {
@romeoh
romeoh / mpui
Last active December 14, 2015 07:59
css, animate, drag 기본 css로 작동하는 마지막 버전
/********************************************
* mpui.js
* morpheus UI Framework
* Author : 백국경 ([email protected])
* Copyright © 2013 Uracle Co., Ltd.
* 166 Samseong-dong, Gangnam-gu, Seoul, 135-090, Korea All Rights Reserved.
* 베타버전입니다. 버그는 [email protected]로 보고해주세요.
*******************************************/
(function(g, d, w, undefined) {
@romeoh
romeoh / gist:5001342
Created February 21, 2013 02:02
toHex
function onInitPage(){
console.log(toHex('김'))
console.log(toHex('K'))
}
function toHex(str){
var hex = '';
for (var i=0; i<str.length; i++){
hex += str.charCodeAt(i).toString(16);
}
return hex;
@romeoh
romeoh / gist:4993781
Created February 20, 2013 07:58
by value, by reference
// by value
var ref_1 = "string...";
var test_1 = ref_1;
ref_1 = "none";
console.log(test_1)
// by value : Wrapper Object (String, Number, Boolean)
var ref_2 = new String("hello world");
var test_2 = ref_2;
ref_2 = new String("world");