Skip to content

Instantly share code, notes, and snippets.

View dtinth's full-sized avatar

Thai Pangsakulyanont dtinth

  • @bemusic                 @creatorsgarten                 @eventpop                 @showdownspace                 @spacetme                @wonderfulsoftware                
  • Krungthepmahanakhonamonrattanakosinmahintharayutthayamahadilokphopnoppharatratchathaniburiromudomratchaniwetmahasathanamonphimanawatansathitsakkathattiyawitsanukamprasit (Bangkok), Thailand
  • YouTube @dtinth
View GitHub Profile
kfox /
Last active December 4, 2023 11:08
TCP echo server for Node.js

TCP echo server for Node.js


  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
const roundNum = (i, j) => Math.max(Math.abs(i), Math.abs(j))
const sumRange = n => (n * (n + 1)) / 2
const accumulateBy = f => n => f(sumRange(n))
const roundCircumference = n => 8 * n
const accumulateDistanceUpToRound = accumulateBy(roundCircumference)
const distanceOnOuterRound = (i, j) => {
const n = roundNum(i, j)
halgari / gist:f431b2d1094e4ec1e933969969489854
Last active April 16, 2023 04:06
What I want from a Type System
The question was asked why I (as a programmer who prefers dynamic languages) don't consider static types "worth it". Here
is a short list of what I would need from a type system for it to be truely useful to me:
1) Full type inference. I would really prefer to be able to write:
(defn concat-names [person]
(assoc person :full-name (str (:first-name person)
(:second-name person))))
And have the compiler know that whatever type required and produced from this function was acceptible as long as the

Most active GitHub users in Thailand

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Wed, 29 Jul 2015 01:52:41 GMT till Fri, 29 Jul 2016 01:52:41 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

 .filter(user => user.followers > 6)
jasongilman /
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

ygotthilf /
Last active April 15, 2024 17:21
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
mohayonao / morse-code.json
Created July 14, 2014 06:18
"0": "-----",
"1": ".----",
"2": "..---",
"3": "...--",
"4": "....-",
"5": ".....",
"6": "-....",
"7": "--...",
"8": "---..",
toolness /
Last active June 22, 2023 11:52
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
Before using this script, you'll need to create a private
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.