... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| var TC = {}; | |
| TC.type = function(typestr) { | |
| return function(msg) { | |
| return function(p, key) { | |
| if (typeof(p) !== typestr) | |
| throw new TypeError(makeMessage(key, msg || 'must be of type ' + typestr)); | |
| } | |
| } | |
| } |
| # Shifted this file to my blog | |
| The new link is on my blog: https://wei2912.github.io/index.html#introduction_to_haskell | |
| I'll update the post on my blog from now on. | |
| --- | |
| Introduction to Haskell | |
| --- |
| #!/bin/bash | |
| CURRENT_IP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'` | |
| curl -H 'X-DNSimple-Token: <EMAIL>:<API_TOKEN>' \ | |
| -H 'Accept: application/json' \ | |
| -H 'Content-Type: application/json' \ | |
| -X PUT \ | |
| -d '{"record":{"name":"<DOMAIN_NAME>", "content":"'$CURRENT_IP'"}}' \ | |
| https://api.dnsimple.com/v1/domains/chiwanpark.com/records/<DNS_RECORD_ID> \ |
| defmodule ROP do | |
| defmacro try_catch(args, func) do | |
| quote do | |
| (fn -> | |
| try do | |
| unquote(args) |> unquote(func) | |
| rescue | |
| e -> {:error, e} | |
| end |
| case class Node(value: Int, next: Option[Node]) | |
| def reverse(node: Node, prev: Option[Node] = None): Node = { | |
| val reversed = node.copy(next = prev) | |
| node.next map {reverse(_, Some(reversed))} getOrElse reversed | |
| } | |
| /****************************************************************/ | |
| val one = Node(1,Some(Node(2,Some(Node(3,None))))) | |
| println(s"$one\n${reverse(one)}") |
| ;; package -- Summary | |
| ;;; Commentary: | |
| ;;; Code: | |
| (require 'company) | |
| (require 'cl) | |
| (defun cwb-fuzzy-check (fuzz) |
Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.
| #!/bin/bash | |
| set -x | |
| exec 2>/dev/null | |
| unset HTTPS_PROXY | |
| unset HTTP_PROXY | |
| unset http_proxy | |
| WARNDAYS=14 |