Skip to content

Instantly share code, notes, and snippets.

A Journey into Haskell and Open Source

I want to write something to celebrate the latest and I hope the last release of wstunnel, a TCP/UDP tunneling websocket tool, and share with you at the same time my story with Haskell and OpenSource projects.

A venture into Haskell

This open source project is not my only one, but is found to my hearth because it brought me joy, despair, proud, shame and further reach that I wasn't even expecting at first. If you have not noticed, the program is written in Haskell. I started learning it, well 8 years ago now..., when I was studying abroad in South Korea. At the time I was struggling with the feeling that I was not enough, I already knew C++ and Java, but was feeling like stagnating while there was so much more that I wasn't knowing. I wanted to be more and thus I needed to dedicate myself to learn more in order to be better. This fear of stagnation is still present in me even today, and if you are working as a programmer, I t

@matthewjberger
matthewjberger / instructions.md
Last active January 8, 2022 12:47
How to Install OpenCV 3, OpenCV_Contrib, and nteract on Windows

Installing OpenCV on Windows

First open a powershell terminal install the scoop package manager:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with:

@gryzzly
gryzzly / getBoundingBox-center-distance.js
Created July 17, 2017 17:22
Get bbox from coordinates and distance
/**
* Get bounding box from set of coordinates [lat,lng] and distance in (deg) adopted to JS
*
* @param {number} distance - distance (deg) from the point represented by centerPoint
* @param {array} centerPoint - two-dimensional array containing center coords [latitude, longitude]
* @description
* Computes the bounding coordinates of all points on the surface of a sphere
* that has a great circle distance to the point represented by the centerPoint
* argument that is less or equal to the distance argument.
* Technique from: Jan Matuschek <http://JanMatuschek.de/LatitudeLongitudeBoundingCoordinates>
@luismoramedina
luismoramedina / ExtractPublicKeyFromCer.java
Created January 30, 2017 10:11
Extract public key from x509 certificate
String cer = "/home/luis/Downloads/APImIntranet.cer";
FileInputStream fileInputStream = new FileInputStream(cer);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate)cf.generateCertificate(fileInputStream);
PublicKey publicKey = cert.getPublicKey();
byte[] encoded = publicKey.getEncoded();
byte[] b64key = Base64.getEncoder().encode(encoded);
System.out.println("b64key = " + new String(b64key));
@erdem
erdem / countries.json
Last active May 30, 2024 22:37
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@diorahman
diorahman / convert.md
Last active November 23, 2020 19:16
How to convert ssh-rsa key to loadable botan's X509

So I need to load the X509 key generated from ssh-keygen.

e.g.

$ ssh-keygen -t rsa -b 1024 -C "bla@bla.com"

PUBLIC

@lanceliao
lanceliao / dnsmasq-gfwlist.py
Last active August 18, 2023 11:26
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@sandyxu
sandyxu / rbenv-install-and-using.md
Last active March 21, 2024 06:23
使用 rbenv 安装和管理Ruby版本

常用的几个 Ruby 版本管理工具有:rvmrbenv,ry,rbfu。rvm 应该是最早出现、使用最多的,因为过于强大以至于违背了某个 Linux 软件开发原则,所以出现了很多轻便的替代者,其中来自 37signals 的 rbenv 就很受欢迎。ry 和 rbfu 看上去更轻便,不过使用不广泛。之前使用过rvm, 这次尝试下rbenv。

我的环境是 Ubuntu14.04

1. 安装 rbenv

rbenv的源代码托管在github,在终端中,从 github 上将 rbenv 源码 clone 到本地,然后设置 $PATH。

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &gt;&gt; ~/.bashrc
@kofemann
kofemann / GuavaCacheMXBean.java
Created September 25, 2013 16:12
Expose Google's guava Cache vie JMX
public interface GuavaCacheMXBean {
public long getRequestCount();
public long getHitCount();
public double getHitRate();
public long getMissCount();
@ellios
ellios / DBCPDemo.java
Created July 23, 2012 04:45
DBCPDemo
public class DBCPDemo {
public static void main(String[] args) throws SQLException {
System.out.println("Setting up data source.");
DataSource dataSource = setupDataSource();
System.out.println("Done.");
//
// Now, we can use JDBC DataSource as we normally would.
//