Skip to content

Instantly share code, notes, and snippets.

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)

간결하고 부정확한 프로그래밍 언어의 역사

원문에서 번역 및 (잼을 추가하기 위해)첨삭.

1800

조제프 마리 자카르 Joseph Marie Jacquard는 오바로크 기계에(원문은 방직기계) 천공카드를 먹여 최초의 초-다중쓰레드 처리장치를 개발했다 (역주: thread에는 바느질 실이라는 뜻이 있다). 이 발명품은 로봇이 일감을 빼앗을 것을 우려하는 당시의 노동자에게 거대한 반대를 받았다.

export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])):
// components
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=>
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):(
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props

Easy Scala Publication

The following describes how you can publish artifacts for any sbt project using the GitHub Package Registry and the sbt-github-packages plugin.

Step 1: Create a GitHub Token

In your GitHub account, go to Settings > Developer settings > Personal access tokens, then click on Generate new token (or click here). Fill in some sort of meaningful name (I chose Dev) and click on the write:packages checkbox:

the new personal access token page with the above steps having been followed

@johnynek
johnynek / dotty_list.scala
Last active January 12, 2020 13:43
Implementation of linked list using dotty features (opaque type, union types, extension methods, type lambda).
// unfortunately
// opaque type Fix[F[_]] = F[Fix[F]]
// won't work (no recursion in opaque type), but this implementation is safe, but scary due to asInstanceOf
object FixImpl {
type Fix[F[_]]
inline def fix[F[_]](f: F[Fix[F]]): Fix[F] = f.asInstanceOf[Fix[F]]
inline def unfix[F[_]](f: Fix[F]): F[Fix[F]] = f.asInstanceOf[F[Fix[F]]]
}
@melvic-ybanez
melvic-ybanez / akka_http_and_cats_validation.md
Last active January 22, 2024 18:29
Request Validation with Akka-HTTP and Cats

Request Validation with Akka-HTTP and Cats

Greg Beech wrote an article on Akka HTTP Entity Validation. This post is on the same topic, except we are going to use typeclass instances, as opposed to subtyping, for form validations.

Sample Problem: User Regsitration

To start with, let us suppose that we are working on some sort of user management service using Scala/Akka. However, here we are only going to focus on the registration part, in which the client is expected to send a user data, in JSON format; and the server needs to validate them, and save the user if the validations succeed, or reject the request with all the errors detected. That said, we should keep in mind that our validations may be used through out the entire codebase, not just in the user registration endpoint.

The rules for our validation are as follows:

@lifthrasiir
lifthrasiir / daerim.md
Last active May 23, 2019 06:11
<대림동에서 보낸 서른 번의 밤>의 웹 호환성 문제에 대해 (2019-02-03)

아래 내용은 지난 2월 3일 webmaster@sisain.co.kr에 보낸 메일을 거의 그대로 전재한 것이다. 두 달 넘게 응답은 없었다.

10일 넘게 응답을 받지 못한 뒤 김동인 담당 기자에게 트위터로 연락을 시도했으나 이 또한 응답받지 못했다.

해당 기사는 현재도 여전히 파이어폭스에서 정상적으로 표시되지 않는다. (2019-04-15)

안녕하세요. [<대림동에서 보낸 서른 번의 밤>][1] 기사를 보고 사소하지만 중요할 수 있는 문제를 알려 드리고자 글을 씁니다.

본 기사는 (요즈음에는 뉴욕타임즈 따위가 너무 많이 써서 오히려 식상할 수 있는) 스크롤할 때마다 애니메이션이 튀어 나오는 인터랙티브 포맷을 쓰고 있습니다만, 해당 포맷이 구글 크롬에서만 테스트된 것으로 보입니다. 모든 브라우저를 테스트하진

@outsideris
outsideris / post.md
Created January 9, 2019 09:45
terraform 글 무단 전제 관련

오늘 어떤 분이(성함을 밝혀도 되는지 몰라서...) 오라클 클라우드 기술 블로그의 글제가 쓴 Terraform 글을 그대로 가져다가 문체만 바꿔서 올렸다는 것을 알게 되었습니다.

당연히 출처표기는 없었고 글의 내용을 확인 결과 제 글을 바탕으로 국문으로 작성한 용어를 영문으로 교체하거나 맞춤법을 교정하거나 반말로 작성한 문장을 존댓말로 바꾸고 일부 내용을 오라클 클라우드에 올렸다는 것을 확인했습니다.

제 글의 내용이 전체 글의 대부분이기 때문에 의도적으로 제 글을 가져가셔 편집 후 직접 작성한 것처럼 보이도록 의도했다고 생각하고 있고 제 글이 CC BY-NC-SA 2.0 라이센스 하에 공개하고 있으므로 이는 라이센스 위반이라고 생각하고 있습니다.

해당 블로그는 오라클 클라우드에 대한 블로그이고 글을 쓰신 "강지선"님도 "한국 오라클의 클라우드 세일즈 컨설팅 팀 소속"이라고 써 있는 것으로 보아 해당 블로그는 한국 오라클에서 운영하는 블로그로 보입니다.

혹시 글이 변경되거나 지워질 지 몰라서 스크린샷을 첨부합니다.

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg