Skip to content

Instantly share code, notes, and snippets.

View alapini's full-sized avatar
🎯

Luc Alapini alapini

🎯
View GitHub Profile
@unclechu
unclechu / algebraic_data_types_experiment.nim
Last active March 14, 2025 17:10
Nim: algebraic data types (Maybe and Either), kinda Eq typeclass instances, kinda functors
type
MaybeKind = enum Just, Nothing
Maybe[T] = object
case kind: MaybeKind
of Just: value: T
of Nothing: discard
EitherKind = enum Left, Right
Either[L, R] = object
case kind: EitherKind
@ammarshah
ammarshah / all_email_provider_domains.txt
Last active July 3, 2025 09:05
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
@anilsathyan7
anilsathyan7 / numbamatmul.py
Created July 31, 2017 15:09
Python numba matrix multiplication
import time
import numba
from numba import jit
import numpy as np
#input matrices
matrix1 = np.random.rand(30,30)
matrix2 = np.random.rand(30,30)
rmatrix = np.zeros(shape=(30,30))
@codehacken
codehacken / hclustering.py
Created July 27, 2017 20:01
Agglomerative clustering using Scikit-Learn (with a custom distance metric)
"""
Hierarchial Clustering.
The goal of gist is to show to use scikit-learn to perform agglomerative clustering when:
1. There is a need for a custom distance metric (like levenshtein distance)
2. Use the distance in sklearn's API.
Adapted from: sklearn's FAQ.
http://scikit-learn.org/stable/faq.html
"""
import React from 'react'
import hoistNonReactStatics from 'hoist-non-react-statics'
import { assoc, assocPath, identity, is, map, prop } from 'ramda'
import isValid from './isValid'
// random helper function
// extract the needed information from the event
const getValueName = (e) => {
const target = e.target
const name = target.name
@ugurerkan
ugurerkan / zimbra-letsencrypt-renew.md
Last active September 9, 2023 13:19
Zimbra 8.6.0 Letsencrypt SSL renew walkthrough.
@fdidron
fdidron / App.js
Last active April 11, 2023 13:54
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@juhaelee
juhaelee / react-typescript.md
Last active June 17, 2025 15:17
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@kmizu
kmizu / parsers.nim
Created July 1, 2016 00:51
parser combinator library in Nim
import strutils
import lists
import re
type
Parser[T] = proc(input: string): Maybe[(T, string)]
Maybe*[T] = object
value: T
hasValue: bool
@gitawego
gitawego / simple-server.java
Last active December 17, 2019 02:56
simple HTTP server in Java
package com.stackoverflow.q3732109;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;