Skip to content

Instantly share code, notes, and snippets.

@nanha
nanha / gist:4727678
Created February 7, 2013 01:43
Twitter Archive 페이지에서 핵심인 application.min.js
var Grailbird = function (b, a, c) {
Grailbird.data = Grailbird.data || {};
Grailbird.data[b + "_" + a] = c
};
(function (b) {
var f = {}, e = {}, a = {};
var c = {
empty_month: Hogan.compile('<li class="without-tweets" title="" rel="tooltip" data-placement="bottom" data-date="" data-count="0"><span class="value">{{this_month}}</span></li>'),
month_bar: Hogan.compile('<li><a href="#" class="with-tweets" title="{{str_title}}: {{str_count}}" rel="tooltip" data-placement="bottom" data-idx="{{data_idx}}" data-date="{{str_title}}" data-count="{{this_count}}"><span class="bar" style="height: {{this_height}}%;"></span><span class="value">{{this_month}}</span></a></li>'),
header_str: Hogan.compile('{{title_str}} <span class="count">{{count}} {{content_type}}</span>'),
@nanha
nanha / gist:4713889
Last active December 12, 2015 04:19
@da Young Shin 님에게 제공
expressjs 설치 후, 아래 3개 파일만 변경하면 업로드가 가능합니다.
views/index.jade
==================
extends layout
block content
h1= title
@nanha
nanha / gist:4697025
Created February 2, 2013 12:04
colors.js
/*
colors.js
Copyright (c) 2010
Marak Squires
Alexis Sellier (cloudhead)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@nanha
nanha / gist:4529517
Created January 14, 2013 11:40
alert(1)
(+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]
]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+
!+[]+!+[]]+(!+[]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])
[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]
)[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+
[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])
[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!
+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!+[]+[][(![
]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+
[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[]
@nanha
nanha / gist:4529391
Created January 14, 2013 11:12
# 모든 압축파일 통일 해제
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
@nanha
nanha / gist:4411104
Created December 30, 2012 05:08
터미널 CLI 단축키
Ctrl-B 영/문자 단위로 좌측으로 커서를 한칸 이동한다.
Ctrl-F 영/문자 단위로 우측으로 커서를 한칸 이동한다.
Ctrl-A. 현재 작업라인에 시작문자로 커서를 이동한다.
Ctrl-E. 현재 작업라인의 제일 끝으로 커서를 이동한다.
Esc B. 한단어 기준으로 좌측으로 커서를 이동한다. :: ESC 키를 누른후 곧바로 B 키를 누르셔야 합니다.
@nanha
nanha / gist:4410453
Created December 30, 2012 01:38
cluster messaging
var cluster = require('cluster');
if (cluster.isWorker) {
console.log('Worker ' + process.pid + ' has started.');
// Send message to master process.
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'})
// Receive messages from the master process.
@nanha
nanha / gist:3671768
Created September 8, 2012 04:22
Node.js 에서 실행할 수 있는 외부 솔루션을 어떻게 컨트롤 하는가?
Node.js 에서 실행되는 외부 솔루션을 사용하는 경우는 자주 발생합니다. 제가 사용하는 방법은 아래와 같습니다.
$ cat subprocess.js
/**
* subprocess module
*
* @author nanhapark
*/
var spawn = require('child_process').spawn;
@nanha
nanha / gist:3594294
Created September 2, 2012 02:48
gmail bookmarklet :: 원하는 웹사이트 누구에게 보내고 싶을 때 사용하세요. 매우 유용합니다.
javascript:(function(){m='http://mail.google.com/mail/?ui=1&view=cm&fs=1&tf=1&to=@gmail.com&su='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(document.location);w=window.open(m,'addwindow','status=no,toolbar=no,width=575,height=545,resizable=yes');setTimeout(function(){w.focus();}, 250);})();
@nanha
nanha / gist:3550434
Created August 31, 2012 08:49
xguru 님의 트위터 백업을 연계하여 검색을 쉽게 할 수 있도록 도와주는 북마클릿 서비스입니다.
javascript:(function(){var surl='http://twitter.xguru.net/index.php?s=';var reply=prompt('%EA%B2%80%EC%83%89%EC%96%B4 %EC%9E%85%EB%A0%A5%ED%95%98%EC%84%B8%EC%9A%94!');if(!reply) return; window.open(surl+reply, '_blank', 'width=670,height=700,scrollable=1,resizable=1');})();