Skip to content

Instantly share code, notes, and snippets.

@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
@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

;; package -- Summary
;;; Commentary:
;;; Code:
(require 'company)
(require 'cl)
(defun cwb-fuzzy-check (fuzz)
@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)}")
@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
@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> \
@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
---
@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));
}
}
}
@kachayev
kachayev / concurrency-in-go.md
Last active May 4, 2025 05:48
Channels Are Not Enough or Why Pipelining Is Not That Easy

Understanding this in JavaScript

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)