Skip to content

Instantly share code, notes, and snippets.

View dahlia's full-sized avatar

Hong Minhee (洪 民憙) dahlia

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.

@shazow
shazow / secp256k1.rb
Last active January 24, 2023 01:21
Homebrew recipe for secp256k, put it into /usr/local/Library/Formula/secp256k1.rb or run: brew install https://gist.github.com/shazow/c71c652409015479a7e6/raw/secp256k1.rb
class Secp256k1 < Formula
desc "Optimized C library for EC operations on curve secp256k1"
homepage "https://github.com/bitcoin/secp256k1"
url "https://github.com/bitcoin/secp256k1.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
@Xion
Xion / sqla_regex.py
Last active May 13, 2021 05:16
Regular expression filters in SQLAlchemy
"""
Module implementing an enhanced string column type for SQLAlchemy
with a support for regular expression operators in Postgres and SQLite.
"""
import re
from sqlalchemy import String as _String, event, exc
from sqlalchemy.engine import Engine
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import BinaryExpression, func, literal
from sre_parse import Pattern, SubPattern, parse as sre_parse
from sre_compile import compile as sre_compile
from sre_constants import BRANCH, SUBPATTERN
class Scanner(object):
def __init__(self, tokens, flags=0):
subpatterns = []
pat = Pattern()
@dahlia
dahlia / wsgi_typing.py
Last active June 10, 2018 07:09
WSGI application object type specified using typing
import types
from typing import (Any, Callable, Iterable, Mapping,
Optional, Sequence, Tuple, Union)
__all__ = ('Environ', 'ExcInfo', 'ResponseStream', 'StartResponse',
'StartResponseCallable', 'StartResponseCallableWithExcInfo',
'WriteCallable', 'WsgiApplication')
# https://www.python.org/dev/peps/pep-3333/#the-write-callable

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active May 29, 2024 13:06
webRTC stun / turn server list
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 11, 2024 07:26
Hyperlinks in Terminal Emulators
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD