Skip to content

Instantly share code, notes, and snippets.

import re
def inline_func(code: str, globals_=None, locals_=None):
if globals_ is None: globals_ = globals()
if locals_ is None: locals_ = locals()
lines = code.splitlines(keepends=True)
indent = None
func_name = None
//
// randexp v0.4.2
// Create random strings that match a given regular expression.
//
// Copyright (C) 2016 by Roly Fentanes (https://github.com/fent)
// MIT License
// http://github.com/fent/randexp.js/raw/master/LICENSE
//
;!function () {
var name = 'RandExp';
class MicroRoute extends Route {
/** @var array */
private $callbacks;
/**
* @param string URL mask, e.g. '<presenter>/<action>/<id \d{1,3}>'
* @param int flags
*/
public function __construct($mask, $flags = 0) {
@icaine
icaine / Lock.php
Created July 8, 2014 11:50
Simple lock managing mechanism
use Nette\Utils\Strings;
class Lock {
/** @var string */
protected $dir;
/** @var array */
protected $lockHandle = array();