Skip to content

Instantly share code, notes, and snippets.

View yhs0602's full-sized avatar
🥝

Hyeonseo Yang yhs0602

🥝
View GitHub Profile
@Zeta611
Zeta611 / adt.py
Last active March 1, 2022 02:44
[ADT in Python] Algebraic data type (sum type) in Python #demo
from dataclasses import dataclass
@dataclass(frozen=True)
class Var:
name: str
@dataclass(frozen=True)
class Int:
@lucj
lucj / docker-compose.yaml
Created January 7, 2021 09:50
fluent-bit / loki / grafana on Docker Swarm
version: '3.8'
configs:
loki-conf:
file: ./loki.conf
fluent-bit-conf:
file: ./fluent-bit.conf
networks:
monitoring:
@DOBRO
DOBRO / UCI-Protocol-Specification.txt
Last active June 18, 2024 11:03
Description of the Universal Chess Interface (UCI)
// Dowloaded from: http://download.shredderchess.com/div/uci.zip
Description of the universal chess interface (UCI) April 2006
=================================================================
* The specification is independent of the operating system. For Windows,
the engine is a normal exe file, either a console or "real" windows application.
* all communication is done via standard input and output with text commands,
@Zeta611
Zeta611 / String+disjointedHangul.swift
Last active July 11, 2022 12:45
[String+disjointedHangul] Extends `disjointedHangul` method to `String` #extension #iOS
//
// String+disjointedHangul.swift
//
// Created by Jay Lee on 08/03/2019.
// Copyright © 2019 Jay Lee <jaeho.lee@snu.ac.kr>
// This work is free. You can redistribute it and/or modify it under the
// terms of the Do What The Fuck You Want To Public License, Version 2,
// as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
//
@bastman
bastman / cartesianProduct.kt
Last active November 11, 2023 07:14
Kotlin collections - leftJoin,innerJoin, ...
infix fun <T,O>List<T>.cartesianProduct(others:List<O>):List<Pair<T,O>> =
flatMap{ t:T->
others.map { o-> Pair(t,o) }
}
inline fun <T, O, R> List<T>.mapCartesianProduct(others: List<O>, transform: (Pair<T, O>) -> R): List<R> =
flatMap { t: T ->
others.map { o -> transform(Pair(t, o)) }
}
@marshall
marshall / tupper_k_generator.md
Last active November 27, 2018 12:09
Tupper's self referential formula K-value generator from any bitmap

I blame Sunil

Explanation on Numberphile

$ ./tupper_k_generator.py kubos-logo.jpg
Tupper K: 4851370081043797069526117009366050436467169751191993569135606414438862155770371453584241289040123540835764290480748106579297469000745823841698473083200214756261314470995838411716498141137319883748891932220617163646559245337601667812194386638446130000791689630544645547109043549304112488869690412062712162943919296994357984460429601612633008740350419376958008239159705920690443436571886095990169981093140964956940930188836731629337704527351542629178213799422991411377275182604582346155731146214167261974801893205797483642065625014903535782819823

Test your number here! http://tuppers-formula.tk/

For reference, my company's logo (the test above) looks pretty cool in monochrome!

@smmoosavi
smmoosavi / Exceptions.py
Created May 26, 2017 06:38
graphene-django custom error and better error handling
class ResponseError(Exception):
def __init__(self, message, code=None, params=None):
super().__init__(message)
self.message = str(message)
self.code = code
self.params = params
@dimagimburg
dimagimburg / play_sine_swift3.swift
Created May 23, 2017 21:30
plays sine wav programmatically with swift 3
import UIKit
import AudioKit
import AVFoundation
class ViewController: UIViewController {
var ae:AVAudioEngine?
var player:AVAudioPlayerNode?
var mixer:AVAudioMixerNode?
var buffer:AVAudioPCMBuffer?
@xnuk
xnuk / hyeong.md
Last active February 11, 2024 15:10
난해한 혀엉.... 언어

이 문서가 여기저기 알려짐에 따라, 이곳에 여러가지 댓글이 달리고 있습니다. 개인적으로는 댓글창을 없애버리고 싶지만 그럴 수 없는 터라, 댓글을 달기 전에 한번씩만 더 생각해주셨으면 합니다.

  • 개인적인 감상은 이곳이 아닌 다른 곳에 적어주세요.
  • 동성애 혐오적인 댓글을 달지 마세요.
  • 기타 "난해한 혀엉... 언어"와 관련없는 댓글을 달지 말아주세요.

위 사항들을 포함해 제 마음에 안 드는 댓글들은 임의로 삭제하고 있습니다. 양해 부탁드립니다.