Skip to content

Instantly share code, notes, and snippets.

@kachayev
kachayev / concurrency-in-go.md
Last active September 23, 2025 16:12
Channels Are Not Enough or Why Pipelining Is Not That Easy
@spion
spion / tc.js
Last active August 29, 2015 14:06
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));
}
}
}
@wei2912
wei2912 / intro.lhs
Last active August 29, 2015 14:09
Update with link to my blog.
# 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
---
@chiwanpark
chiwanpark / update-dnsimple
Last active March 27, 2016 10:59
Update DNSimple
#!/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> \
@zabirauf
zabirauf / ROP.ex
Created March 26, 2015 07:48
Railway Oriented Programming macros in Elixir
defmodule ROP do
defmacro try_catch(args, func) do
quote do
(fn ->
try do
unquote(args) |> unquote(func)
rescue
e -> {:error, e}
end
@pathikrit
pathikrit / Node.scala
Last active September 17, 2021 02:02
Reverse a LinkedList in Scala
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)
@olegakbarov
olegakbarov / INSTALLATION.md
Last active July 10, 2020 18:27 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: clean install

OS X 10.11 (El Capitan) / Node.js Developer Environment

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.

Content

@whoeverest
whoeverest / file-share-linux.md
Last active March 2, 2016 12:18
How to make a personal file upload server

Simple file sharing, with Nginx and scp

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
@gdamjan
gdamjan / check-ssl-expiry.sh
Last active April 5, 2017 13:25
cgi bin script to check ssl domains for expiry - https://damjan.softver.org.mk/cgi-bin/ssl.sh
#!/bin/bash
set -x
exec 2>/dev/null
unset HTTPS_PROXY
unset HTTP_PROXY
unset http_proxy
WARNDAYS=14