This is a tutorial that teaches you how to create your own simple file-sharing service. It works in the terminal.
Usage:
$ share ~/pictures/my-funny-kitten.png
http://files.YOURDOMAIN.com/my-funny-kitten.png
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.
;; package -- Summary | |
;;; Commentary: | |
;;; Code: | |
(require 'company) | |
(require 'cl) | |
(defun cwb-fuzzy-check (fuzz) |
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)}") |
defmodule ROP do | |
defmacro try_catch(args, func) do | |
quote do | |
(fn -> | |
try do | |
unquote(args) |> unquote(func) | |
rescue | |
e -> {:error, e} | |
end |
#!/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> \ |
# 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 | |
--- |
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)); | |
} | |
} | |
} |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
It's easy to trip up on the meaning of this
in JavaScript. The behavior is very different from other languages, which means we have to throw most preconceptions and intuition out the window.
The best way to think of this
in JS is as a hidden function argument which is passed in a slightly awkward way. Instead of the normal passing of arguments:
fn(arg1, arg2, arg3)