Skip to content

Instantly share code, notes, and snippets.

View dahlia's full-sized avatar
⚰️
Off work for the bereavement of my father

Hong Minhee (洪 民憙) dahlia

⚰️
Off work for the bereavement of my father
View GitHub Profile

Getting started with PureScript 0.7.x

also posted on http://kyagrd.tumblr.com/post/125748583024/getting-started-with-purescript-0710 Written based on PureScript 0.7.1.0 but shoould work with versions 0.7.0.0 and 0.7.2.0.

Some Triva about PureScript

PureScript is a purely functional language specifically targeting JavaScript as its backend. If you have tasted Haskell and lamenting about the current untyped mess in scripting languages, especially regarding web-programming, probabiy your only choice out there is PureScript.

PureScript is the only language with a sane approch to staticaly support duck typing on records by using Row Polymorphism.

@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@lifthrasiir
lifthrasiir / crypto.md
Last active November 14, 2023 07:10
High-level understanding of cryptography

고수준에서 암호학 이해하기

이 글은 메아리 저널에 쓸 목적으로 한동안 작업하던 글입니다. 메아리 특유의 디자인(...)이 싫다면 여기로 링크하셔도 됩니다. 어느 쪽이든간에 의견은 이 아래의 코멘트 란 또는 메아리에 기재되어 있는 메일 주소를 써 주시면 감사하겠습니다. --lifthrasiir

암호학을 사용하는 많은 시스템은 세부적으로 무슨 알고리즘을 쓰는지보다는 그 알고리즘들이 어떻게 연결되어 있는지, 즉 구조가 실제 안전성에 더 큰 영향을 미친다. 따라서 구조와 그 구조를 이루는 빌딩 블럭을 아는 것이 중요한데, 여기에서는 이러한 암호학적 빌딩 블럭과 함께 블럭들이 어떻게 쓰여서 더 큰 구조를 만드는지를 알아 본다.

Key Exchange

키 교환. 두 사람만이 알 수 있는 새로운 키를 만든다. 이 과정이 끝나도 상대방이 내가 아는 사람인진 알 수 없지만 적어도 상대방과 내가 같은 키를 가지고 있다는 건 확신할 수 있다.

@conatus
conatus / ello.md
Last active April 13, 2023 19:32
Ello API

Ello API

This is a basic exploration of the Ello API. Completely unofficial, your mileage my vary, don't smash their servers as they are likely very busy.

Methods return HTML for their representation where appropriate which is a nice little pattern. Everything returns application/json.

Like this:

{
 "id": ,
@Veedrac
Veedrac / just_some_cplusplus.cpp
Last active May 5, 2019 12:02
Speed test. Warning: Please read first comment
#include <iostream>
#include <iterator>
#include <numeric>
#include <unordered_set>
#include <vector>
int32_t some_calculations(int32_t number) {
std::vector<int32_t> a;
std::unordered_set<int32_t> s;
@lifthrasiir
lifthrasiir / c11-to-rust.md
Last active September 16, 2021 13:30
C11 standard library to Rust standard library (as of 2014-07-19 nightly)

As a response to Issue #15753. Not yet complete.

Some notes:

  • All Rust translations assume the crate root (so the reference to std is freely available). The use of any other crates is noted.
  • Every string or vector argument is assumed to be a slice (&str or &[T]). Otherwise you need to convert String or Vec<T> to a slice with .as_slice() method.

<assert.h>

  • assert(cond): assert!(cond) macro. Note that it's always enabled; if you need to selectively disable the assertions, use debug_assert!(cond) macro.
@eungju
eungju / threaddump.md
Last active March 6, 2017 10:28
파이썬에서 데드락 해결하기 위해 쓰레드 덤프 얻는 방법.

데드락이 걸렸는데 코드를 봐도 어디인지 모를 때가 있다. 자바는 JVM이 쓰레드 덤프 기능을 제공해서 어떤 쓰레드가 어디서 멈춰 있는지 확인하기 쉬웠는데 파이썬은 쓰레드 덤프를 얻으려면 약간의 코딩이 필요하다.

아래와 같이 모든 쓰레드의 스택 트레이스를 볼 수 있다.

for ident, stack in sys._current_frames().items():
    logger.info(("%d" % ident) + "".join(traceback.format_list(traceback.extract_stack(stack))))

어떤 쓰레드가 멈춰 있는지 안다면 그 쓰레드의 스택 트레이스만 볼 수 있다.

@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@dahlia
dahlia / sqla_intlist.py
Last active December 8, 2017 09:58
This module provides integer list in portable way for SQLAlchemy. In this context “portable way” means that you can use it with any backends (dialects) SQLAlchemy supports. It implements special optimizations using `integer[]` type and `@>` operator in PostgreSQL — so you can index the column of this type using GIN as well.
""":mod:`sqla_intlist` --- Portable integer list type for SQLAlchemy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See the docstring of :class:`IntegerList` type.
"""
import collections
import io
from sqlalchemy.dialects.postgresql import ARRAY