Skip to content

Instantly share code, notes, and snippets.

#Try this:
import sys
import time
for i in range (10):
sys.stdout.write('\r'+str(i))
time.sleep(0.5)
import time
loop(Module, State) ->
receive
{call, From, Request} ->
{Result, State2} = Module:handle_call(Request, State),
From ! {Module, Result},
loop(Module, State2);
{cast, Request} ->
State2 = Module:handle_cast(Request, State),
loop(Module, State2)
end.
@doctorx
doctorx / closure.js
Created January 5, 2019 07:37
Сlosure
//Функциональный аргумент (Functional argument, “Funarg”, “Фунарг”) — аргумент, значением которого является функция.
function exampleFunc(funArg) {
funArg();
}
exampleFunc(function () {
alert('funArg');
});
@doctorx
doctorx / iife.js
Created January 5, 2019 07:33
Immediately-Invoked Function Expression (IIFE)
(function () {
// ініціалізований простір.
})();
@doctorx
doctorx / gist:3a4d3c5a23801dd998471f8f13fae2ab
Last active December 5, 2017 11:34
Delete images, container
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@doctorx
doctorx / Error
Last active August 29, 2015 14:13
500 (Internal Server Error)
$ git clone git://github.com/5HT/n2o
$ cd n2o/samples
$ ./mad deps compile plan repl
commit 85eb04782263fff451bca9a05eac6c4912056aec
Author: Maxim Sokhatsky <maxim@synrc.com>
Date: Wed Jan 21 16:52:22 2015 +0200