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 / 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 / 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 / webpack.config.js
Created April 27, 2016 08:08
[DalkStudy] webpack.config.js
module.exports = {
entry: {
app: './src/app.js'
},
output: {
path: __dirname + '/dist',
publicPath: "/assets/",
filename: '[name].bundle.js'
},
devServer: {
@jonnung
jonnung / example.js
Last active April 27, 2016 09:28
[DalkStudy] react-webpack-starter-example.js
var React = require('react');
var ReactDOM = require('react-dom');
var RandomMessage = React.createClass({
getInitialState: function () {
return { message: "Hello, React!" };
},
onClick: function () {
var messages = ['Hello, DalkStudy', 'Hello, Jonnung', 'Hello, Gaerae'];
var randomMessage = messages[Math.floor(Math.random() * 3)];
@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>
);
}