Skip to content

Instantly share code, notes, and snippets.

View zeakd's full-sized avatar

Deokseong Kim zeakd

  • Imweb
  • Seoul, South Korea
View GitHub Profile
@zeakd
zeakd / swagger.py
Created December 19, 2018 08:00
simple apispec, flask, marshmallow integrations
from apispec import APISpec
from apispec.ext.flask import FlaskPlugin
from apispec.ext.marshmallow import MarshmallowPlugin
from flask import jsonify
import marshmallow
spec = APISpec(
title='ttang me',
version='1.0.0',
openapi_version='2.0',
@zeakd
zeakd / squares.js
Last active October 22, 2018 18:18
Examples for explaining arrow function
var numbers = [1,2,3,4,5]
var squares = numbers.map(function (x) {
return x * x;
});
@zeakd
zeakd / squares.cs
Last active October 22, 2018 17:57
Examples for explaining arrow funciton
...
List<int> numbers = new List<int>() { 1,2,3,4,5 };
List<int> squares = numbers
.Select(x => x * x)
.ToList();
...
@zeakd
zeakd / squares.java
Created October 22, 2018 17:23
Examples for explaining arrow funciton
...
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
List<Integer> squares = numbers.stream()
.map(n -> n * n)
.collect(Collectors.toList());
...
@zeakd
zeakd / squares.py
Last active October 22, 2018 17:10
Example to explain the shape of arrow funciton
data = [...]
# without lambda
def square_plus_one(x):
return x * x + 1
map(square_plus_one, data)
# with lambda
@zeakd
zeakd / you-should-write-like-this.html
Last active October 21, 2018 18:24
long long ago.. script in html
<script src='javascript'>
<!--
console.log('Hello, script')
-->
</script>
@zeakd
zeakd / double-thin-arrow-function.js
Created October 21, 2018 18:10
Example to explain the shape of arrow funciton
--> what is this?
--> console.log('hi')
console.log('hello')
<!-- and, what is this?
<!-- console.log('hi')
@zeakd
zeakd / function-and-arrow-function.js
Last active October 21, 2018 18:09
Examples to explain the shape of arrow function
// function
const kim = {
name: 'Kim',
hello: function() {
console.log(`hi, ${this.name}`)
}
}
// arrow function
const lee = {
const widget = {
debug: "on",
window: {
title: "Sample Konfabulator Widget",
name: "main_window",
width: 500,
height: 500
},
image: {
src: "Images/Sun.png",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React 1</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.14.0/babel.min.js'></script>
</head>
<body>