Skip to content

Instantly share code, notes, and snippets.

View pyldin601's full-sized avatar

Roman Lakhtadyr pyldin601

View GitHub Profile
<?php
/**
* Created by PhpStorm.
* User: Roman
* Date: 24.02.2016
* Time: 9:45
*/
namespace App\Dao;
<?php
/**
* @author Roman Gemini <roman_gemini@ukr.net>
* @date 25.03.2016
* @time 15:56
*/
namespace Slang\Database\Fluorite\Concrete;
<?php
/**
* @author Roman Gemini <roman_gemini@ukr.net>
* @date 25.03.2016
* @time 15:54
*/
namespace Slang\Database\Fluorite\Concrete;
<?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"]);
(define (square a)
(* a a))
(define (cube a)
(* a a a))
(define (abs a)
(if (< a 0) (- a) a))
(define (average a b)
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 ?: ""
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.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() {
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.
@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;