Skip to content

Instantly share code, notes, and snippets.

@jonnung
jonnung / default.php
Last active August 29, 2015 14:20
중복 require 되었을때
<?php
if (!isset($conf)) {
$conf = 1;
}
$conf += 1;
return $conf;
@jonnung
jonnung / question_about_javascript_this.js
Last active August 29, 2015 14:17
자바스크립트의 this를 이해하기 위한 문제
// ############ EXAMPLE ############
// CASE1
var obj = {
prop: 'EWJO',
sub_func: function () {
var user = obj.sub_func2();
console.log('Hello ' + user);
},
sub_func2: function () {
return this.prop;
@jonnung
jonnung / create_zombie_process.py
Last active August 29, 2015 14:11
python으로 좀비 프로세스 만들기
# -*- coding: utf8 -*-
import os
import time
from subprocess import Popen
print("# Create zombie process (PID: %s)" % os.getpid())
child_process = Popen(['/usr/local/bin/python', 'zombie.py'])
print("# Fork child-process (PID: %s)" % child_process.pid)
@jonnung
jonnung / tcpChatClient.py
Last active September 7, 2017 02:54
socket, select 모듈을 사용한 TCP 서버/클라이언트 채팅 프로그램
# -*- coding: utf8 -*-
# socket 모듈을 임포트
from socket import *
from select import select
import sys
# 호스트, 포트와 버퍼 사이즈를 지정
HOST = '127.0.0.1'
@jonnung
jonnung / function_call.js
Last active August 29, 2015 14:07
Javascript the good parts - Function #2 (Simplex Internet JS study group)
var myObject = {
value: 1,
increment: function (inc) {
var inc_type = typeof inc;
var that = this;
var minus = function () {
return that.value - 5;
};
this.value += (inc_type === 'number')? inc : 1;