Skip to content

Instantly share code, notes, and snippets.

View SeungUkLee's full-sized avatar
🌱
dot dot dot

Seunguk Lee SeungUkLee

🌱
dot dot dot
  • Republic Of Korea, Busan
View GitHub Profile
@kazu-yamamoto
kazu-yamamoto / gist:4064634
Created November 13, 2012 08:20
Testing Free Monad with QuickCheck
module Main where
import Control.Monad
import Control.Monad.Free
import Prelude hiding (putChar, getChar)
import qualified System.IO as IO
import Test.QuickCheck
----------------------------------------------------------------
-- Our DSL
@acdha
acdha / pre-commit
Last active April 18, 2024 02:22
Git pre-commit hook which runs various code linters. Install this to .git/hooks/pre-commit inside your favorite repos
#!/usr/bin/env PYTHONIOENCODING=utf-8 python
# encoding: utf-8
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import subprocess
import sys
@donnut
donnut / currying.md
Last active October 28, 2023 17:58
TypeScript and currying

TypeScript and currying

In functional programming you often want to apply a function partly. A simple example is a function add. It would be nice if we could use add like:

var res2 = add(1, 3); // => 4

var add10To = add(10);
var res = add10To(5); // => 15
@ericelliott
ericelliott / fp-lingo.md
Last active February 2, 2023 23:33
A Guide to Functional Programming Lingo for JavaScripters

A Guide to Functional Programming Lingo for JavaScripters

Functional programming gets a bad wrap about being too hard for mere mortals to comprehend. This is nonsense. The concepts are actually quite simple to grasp.

The jargon is the hardest part. A lot of that vocabulary comes from a specialized field of mathematical study called category theory (with a liberal sprinkling of type theory and abstract algebra). This sounds a lot scarier than it is. You can do this!

All examples using ES6 syntax. wrap (foo) => bar means:

function wrap (foo) {
@ihoneymon
ihoneymon / springboot-fundamental.md
Last active April 21, 2020 04:51
스프링부트springboot 이야기

1-1 스프링부트springboot 이야기

1. 스프링부트springboot란?

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.

  • 스프링부트는 단독실행되는, 실행하기만 하면 되는 상용화 가능한 수준의 스프링 기반 애플리케이션을, 쉽게 만들어낼 수 있다.
  • 최소한의 설정으로 스프링 플랫폼과 서드파티 라이브러리들을 사용할 수 있도록 하고 있다.

1.1. 스프링부트 기능

import java.util.Arrays;
public class HashCodeFunctions
{
private final static short DEFAULT_PRIME_NUMBER = 31;
private HashCodeFunctions()
{
throw new AssertionError("Could not be instantiated.");
}
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active May 28, 2024 17:41
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@jooyunghan
jooyunghan / haskell_read.md
Last active February 8, 2023 04:09
Haskell 간단 파싱 (Read)

문제

해커랭크 사이트의 문제 중 하나 The Tree of Life 를 풀다가 나온 입력 처리입니다.

위의 문제는 이진 트리가 LISP의 S-expression 형식으로 입력됩니다. 이진 트리의 각 노드 값은 . 이나 X 이고, 브랜치는 괄호로 묶어 왼쪽/자신/오른쪽 순으로 표시됩니다. 예를 들어(X . (. X .))는 아래와 같은 트리를 나타냅니다.

@ihoneymon
ihoneymon / use-git-and-git-flow.adoc
Last active November 8, 2023 22:45
git 을 기반으로 git-flow를 사용하여 애플리케이션 배포버전을 관리하자.

GIT을 기반으로 한 프로젝트 개발프로세스

깃을 사용합시다. 깃을 쓰자. 깃을 쓰란 말야!!

  • SVN은 변경이력이 많아질수록 속도가 느리지.

    • 커밋 및 처리속도가 빠르다. 변경이력이 많이 축적되어 있어도 속도저하가 거의 없다.

  • 커밋찍기가 어렵다.

@ploeh
ploeh / ApiModel.hs
Last active December 24, 2022 22:54
Handling a reservation request in Haskell. Proof of concept
module ApiModel where
import Data.Time (ZonedTime(..), parseTimeM, defaultTimeLocale, iso8601DateFormat)
data ReservationRendition = ReservationRendition
{ rDate :: String
, rName :: String
, rEmail :: String
, rQuantity :: Int }
deriving (Eq, Show, Read)