Skip to content

Instantly share code, notes, and snippets.

View Zeta611's full-sized avatar
🎯
Focusing

Jay Lee Zeta611

🎯
Focusing
View GitHub Profile
@Zeta611
Zeta611 / drawShifted.asy
Last active May 31, 2020 08:06
[drawShifted] Shift a path by an absolute value in Asymptote
void drawShifted(
path g,
pair trueshift,
picture pic=currentpicture,
Label label="",
pen pen=currentpen,
arrowbar arrow=None,
arrowbar bar=None,
margin margin=NoMargin,
marker marker=nomarker
@Zeta611
Zeta611 / pathLabel.asy
Last active May 31, 2020 08:04
[pathLabel] Add a label to a path
void pathLabel(
picture pic=currentpicture,
Label l,
path g,
real position=0.5,
align align=NoAlign,
bool sloped=false,
pen p=currentpen,
filltype filltype=NoFill
) {
@Zeta611
Zeta611 / sample.lua
Last active May 31, 2020 08:02
[Lua sample] Simple demo of a Lua code #demo
-- Use a builder to safely make objects
function build_complex(r, i)
return {real = r, img = i}
end
-- Accessing a value with a key
complex = build_complex(3, 4)
assert(complex["real"] == complex.real)
print(complex.real)
@Zeta611
Zeta611 / capture.lua
Last active May 31, 2020 08:02
[Lua capture] Shows a full lexical scoping of Lua
function enable_counting()
local count = 0
local old_print = print
print = function(...)
count = count + 1
old_print(...)
end
return function() return count end
end
@Zeta611
Zeta611 / List.swift
Last active August 9, 2022 12:51
[List] Demonstration of a recursive data type in Swift #algorithm #demo
precedencegroup ListOperationPrecedence {
associativity: right
higherThan: MultiplicationPrecedence
}
infix operator ++: ListOperationPrecedence
infix operator |*: ListOperationPrecedence
indirect enum List<T> {
case `nil`
@Zeta611
Zeta611 / memoize.ml
Created March 13, 2020 14:26
[memoize] General memoization function #algorithm
let memoize ?(size = 100) f =
let tbl = Hashtbl.create size in
let rec g = fun x ->
try Hashtbl.find tbl x
with Not_found ->
let v = f g x in
Hashtbl.add tbl x v;
v
in
f g
@Zeta611
Zeta611 / work.sh
Last active March 13, 2020 14:27
[ffmpeg script] #ffmpeg #automation
ffmpeg -i ~/lecture-videos/week1_edit.mov -ss 00:00:00 -t 00:13:00 ~/lecture-videos/week1_edit_part1.mp4
ffmpeg -ss 00:10:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:00 ~/lecture-videos/week1_edit_part2.mp4
ffmpeg -ss 00:20:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:00 ~/lecture-videos/week1_edit_part3.mp4
ffmpeg -ss 00:27:00 -i ~/lecture-videos/week1_edit.mov -t 00:13:44 ~/lecture-videos/week1_edit_part4.mp4
ffmpeg -ss 00:00:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part1.mp4
ffmpeg -ss 00:10:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part2.mp4
ffmpeg -ss 00:20:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:00 ~/lecture-videos/week2_edit_part3.mp4
ffmpeg -ss 00:25:00 -i ~/lecture-videos/week2_edit.mov -t 00:13:26 ~/lecture-videos/week2_edit_part4.mp4
@Zeta611
Zeta611 / Android 개발을 수주해서 Kotlin을 제대로 써봤더니 최고였다.md
Created December 18, 2019 09:01
Android 개발을 수주해서 Kotlin을 제대로 써봤더니 최고였다라는 글을 번역했습니다.

Android 개발을 수주해서 Kotlin을 제대로 써봤더니 최고였다.

글에 앞서

이 글은 일본의 omochimetaru님이 Qiita에 올린 Android 개발을 수주해서 Kotlin을 제대로 써봤더니 최고였다.라는 글을 번역해서 만들었습니다. 번역을 흔쾌히 허락해주신 omochimetaru님께 감사하다는 말씀 드립니다. 또한 글에서 한국에서는 쓰이지 않는 표현들 등에 대해서는 의역이 섞여있습니다. 이 점 양해 부탁드립니다. 늦은 시간까지 오역을 찾고 번역의 질을 높이는데 많은 도움을 주시고 오히려 저보다 많이 고생해주신 이상한모임의 pluulove님, chiyodad님, lemonade님께도 감사하다는 말씀 드립니다. 읽어주셔서 감사합니다.

Kotlin을 실무 프로젝트에서 사용했습니다.

며칠 전, 제가 소속된 Qoncept에서 "리얼 술래잡기"x후지큐 하이랜드 거대 유원지에서부터의 도주를 개발했고 출시했습니다.

@Zeta611
Zeta611 / UIBarButtonItem+Badge.swift
Last active August 30, 2019 11:54 — forked from freedom27/UIBarButtonItem+Badge.swift
[UIBarButtonItem+Badge] #iOS #extension
//
// UIBarButtonItem+Badge.swift
//
// Created by Jaeho Lee on 30/08/2019.
// Copyright © 2019 Jay Lee <jaeho.lee@snu.ac.kr>
//
// Original Source:
// https://gist.github.com/freedom27/c709923b163e26405f62b799437243f4
//
@Zeta611
Zeta611 / sieve.c
Last active February 24, 2020 01:12
[Sieve of Eratosthenes in C] #algorithm
/**
* sieve.c
*
* Created by Jay Lee on 08/25/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.
*/