Skip to content

Instantly share code, notes, and snippets.

@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;
@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 / 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 / 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 / default.php
Last active August 29, 2015 14:20
중복 require 되었을때
<?php
if (!isset($conf)) {
$conf = 1;
}
$conf += 1;
return $conf;
@jonnung
jonnung / AutoloadClass.php
Created May 19, 2015 02:15
Composer 없이 PSR-4로 Autoload 구현하기
<?php
namespace Moveopn\Vendor\Autoload;
/**
* An example of a general-purpose implementation that includes the optional
* functionality of allowing multiple base directories for a single namespace
* prefix.
*
* Given a foo-bar package of classes in the file system at the following
* paths ...
@jonnung
jonnung / k-means_clustering.ipynb
Last active September 3, 2015 09:13
K-Means_Clustering
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First React Example</title>
</head>
<body>
<div id="greeting-div"></div>
<script src="https://fb.me/react-15.0.0.js"></script>
<script src="https://fb.me/react-dom-15.0.0.js"></script>
@jonnung
jonnung / react-quick-start.html
Last active April 26, 2016 15:09
[DalkStudy] React Quick Start
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First React Example</title>
</head>
<body>
<div id="greeting-div"></div>
<script src="https://fb.me/react-15.0.0.js"></script>
<script src="https://fb.me/react-dom-15.0.0.js"></script>
@jonnung
jonnung / react-webpack-module-require.js
Last active April 28, 2016 01:36
[DalkStudy] React를 모듈로 불러오기 (CommonJS st.)
// CommonJS style
var React = require('react');
var ReactDOM = require('react-dom');
var Greeting = React.createClass({
render: function () {
return (
<p> Hello, Dalk Study</p>
);
}