Skip to content

Instantly share code, notes, and snippets.

View pyldin601's full-sized avatar

Román Lakhtadyr pyldin601

View GitHub Profile
@pyldin601
pyldin601 / LICENCE SUBLIME TEXT
Created December 2, 2016 13:48
Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
@pyldin601
pyldin601 / main.py
Created October 29, 2016 12:45
Type strict in python 3.5
import inspect
def use_strict(func):
signature = inspect.signature(func)
def validate_args(*args):
params = signature.parameters.values()
types = map(lambda p: p.annotation, params)
zipped = zip(list(*args), types)
@pyldin601
pyldin601 / tailrecursion.php
Last active August 18, 2023 11:20 — forked from beberlei/tailrecursion.php
PHP Tail Recursion
<?php
function tail($fn)
{
$underCall = false;
$pool = [];
return function (...$args) use (&$fn, &$underCall, &$pool) {
$result = null;
$pool[] = $args;
public static function tokenize($code)
{
// Initial state of parser
$baseIter = function ($rest, $acc) use (&$baseIter, &$symbolIter, &$stringIter, &$commentIter) {
if (sizeof($rest) == 0) {
return $acc;
}
list ($head, $tail) = toHeadTail($rest);
switch ($head) {
// We got '(', so we just add it to list of lexemes.
package biz.radioteria.flow.stream
import com.sun.org.apache.xpath.internal.operations.Bool
import junit.framework.TestCase
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.io.OutputStream
class OutputStreamsTest : TestCase() {
package biz.radioteria.flow.stream
import java.io.IOException
import java.io.OutputStream
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
class NonblockingOutputStream(private val outputStream: OutputStream) : OutputStream() {
package biz.radioteria.web.server
import biz.radioteria.web.request.Request
import biz.radioteria.web.request.RequestMethod
import com.sun.net.httpserver.HttpExchange
fun fromHttpExchange(httpExchange: HttpExchange): Request {
val method = httpExchange.requestMethod
val path = normalizedRequestPath(httpExchange.requestURI.path)
val query = httpExchange.requestURI.query ?: ""
(define (square a)
(* a a))
(define (cube a)
(* a a a))
(define (abs a)
(if (< a 0) (- a) a))
(define (average a b)
<?php
/**
* Define routes for your application in this file.
* Use $this keyword as Router instance.
*
* @var \Slang\Routing\Router $this
*/
$this->get("/", "HomeController::index", ["name" => "home"]);
<?php
/**
* @author Roman Gemini <[email protected]>
* @date 25.03.2016
* @time 15:54
*/
namespace Slang\Database\Fluorite\Concrete;