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 / 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 / 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.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.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 / 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',