Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
๐Ÿ‹
ฮป

iomonad iomonad

๐Ÿ‹
ฮป
  • 11:39 (UTC +03:00)
View GitHub Profile
@iomonad
iomonad / happyeyeballs.clj
Last active February 22, 2019 14:31 — forked from leonoel/deps.edn
happy eyeballs
(ns happyeyeballs
(:require [missionary.core :as m])
(:import (java.net InetAddress InetSocketAddress)
(java.nio.channels AsynchronousSocketChannel CompletionHandler)
(java.util.concurrent.atomic AtomicBoolean)))
(defn happyeyeballs
"Tries to establish a connection to a host associated with multiple endpoints, following the Happy Eyeballs protocol.
Given a sequence of tasks performing the connection to each endpoint, returns a task sequentially performing connection

Applied Functional Programming with Scala - Notes

Copyright ยฉ 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
package alwyzon.irc
/*
<message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf>
<prefix> ::= <servername> | <nick> [ '!' <user> ] [ '@' <host> ]
<command> ::= <letter> { <letter> } | <number> <number> <number>
<SPACE> ::= ' ' { ' ' }
<params> ::= <SPACE> [ ':' <trailing> | <middle> <params> ]
<middle> ::= <Any *non-empty* sequence of octets not including SPACE or NUL or CR or LF, the first of which may not be ':'>
<trailing> ::= <Any, possibly *empty*, sequence of octets not including NUL or CR or LF>
@iomonad
iomonad / PassThroughFlow.scala
Created November 5, 2018 14:39 — forked from davideicardi/PassThroughFlow.scala
Akka stream generic pass through flow. For latest implementation see https://developer.lightbend.com/docs/alpakka/current/patterns.html#passthrough
/*
https://scalafiddle.io/sf/sniohcZ/1
Use PassThroughFlow when you have a message that should be used in a
flow that trasform it but you want to maintain the original message for
another following flow.
For example if you consume messages from Kafka (CommittableMessage).
You process the message (transform, save it inside a database, ...) and then you need again the original message
to commit the offset.
@iomonad
iomonad / SimplePartitionSample.scala
Created November 5, 2018 13:50 — forked from johanandren/SimplePartitionSample.scala
Sample of using partition to split up incoming elements over multiple outgoing streams
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
import scala.io.StdIn
import scala.util.Random
object SimplePartitionSample extends App {
implicit val system = ActorSystem()
@iomonad
iomonad / OAuth2.hs
Created September 14, 2018 11:31 — forked from qzchenwl/OAuth2.hs
Simple oauth2.0 implementation in Haskell
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.ByteString.Lazy (toChunks)
import Data.List
import Data.Maybe
import Data.Typeable (Typeable)
@iomonad
iomonad / README
Created August 14, 2018 07:04
Binge - curses client for transmission-daemon
Binge
=====
Another curses client for transmission-daemon. Not fully featured,
but sufficient for my daily torrents. Minimal and experimental.
Screenshot: http://i.imgur.com/2X82oyS.png
Dependencies
============
@iomonad
iomonad / google-dorks
Created August 3, 2018 12:06 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@iomonad
iomonad / ascii.cheatsheet
Created May 31, 2018 14:46 — forked from xero/ascii.cheatsheet
box drawing cheat sheet for ascii art
โ•“โ”€โ”€โ”€โ”€โ”€[ box drawing cheat sheet ]
โ•™โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€ โ”€
โ”€ โ” โ”‚ โ”ƒ โ”„ โ”… โ”† โ”‡ โ”ˆ โ”‰ โ”Š โ”‹ โ”Œ โ” โ”Ž โ”
โ” โ”‘ โ”’ โ”“ โ”” โ”• โ”– โ”— โ”˜ โ”™ โ”š โ”› โ”œ โ” โ”ž โ”Ÿ
โ”  โ”ก โ”ข โ”ฃ โ”ค โ”ฅ โ”ฆ โ”ง โ”จ โ”ฉ โ”ช โ”ซ โ”ฌ โ”ญ โ”ฎ โ”ฏ
@iomonad
iomonad / bash-colors.md
Created May 30, 2018 13:37 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple