Lightweight text indexer for PHP
Uses the dba extension (with db4)
Hello my name is Arnold and I'm not crazy. Arnold's kids are crazy though.
<?php | |
/** | |
* Set the properties (including protected and private) of an object. | |
* This should only be called by the object itself. | |
*/ | |
function object_init(object $object, array $values): void | |
{ | |
$init = function ($values) { | |
foreach ($values as $prop => $value) { |
<?php | |
declare(strict_types=1); | |
use Jasny\Auth; | |
use Jasny\Auth\Confirmation\InvalidTokenException; | |
use Jasny\Persist\Gateway; | |
use Jasny\Session; | |
use Psr\Http\Message\ResponseInterface as Response; |
/** | |
* Use em or rem font-size in Bootstrap 3 | |
*/ | |
@font-size-root: 14px; | |
@font-unit: 0rem; // Pick em or rem here | |
// Convert all variables to em |
<?php | |
/** | |
* `a > b > c > a` should always result in false. | |
*/ | |
function all_greater($a, $b, $c) | |
{ | |
return ($a > $b) && ($b > $c) && ($c > $a); | |
} | |
// Fails due to type juggling. |
<?php | |
$one = [ | |
'arithmetic' => ['+$a', '-$a'], | |
'bitwise' => ['~$a'], | |
'incdec' => ['++$a', '--$a'], | |
'logical' => ['!$a'], | |
]; | |
$two = [ |
<?php | |
use Jasny\DB\Option\Functions as opts; | |
use Jasny\HttpAttributes\Request\Accept; | |
use Jasny\HttpAttributes\Request\ParsedBody; | |
use Jasny\HttpAttributes\Request\PathParam; | |
use Jasny\HttpAttributes\Response\ContentType; | |
use Jasny\HttpAttributes\Route\Delete; | |
use Jasny\HttpAttributes\Route\Get; | |
use Jasny\HttpAttributes\Route\Post; |
<?php | |
$distance = new Meter(3); | |
$cm = $distance->in(Centimeter::class); | |
ecoh $distance; // 3m | |
echo $cm; // 300cm | |
$distance == Decimeter(30); // True | |
$distance === Decimeter(30); // False |
#!/bin/sh | |
## -*-sh-*- | |
#set -x | |
# BEGIN of icu-config-top | |
# Copyright (C) 2016 and later: Unicode, Inc. and others. | |
# License & terms of use: http://www.unicode.org/copyright.html | |
#****************************************************************************** | |
# Copyright (C) 1999-2013, International Business Machines | |
# Corporation and others. All Rights Reserved. | |
#****************************************************************************** |
from lto.accounts import AccountFactoryED25519 | |
from itertools import permutations | |
address = "3JzSs25zWMomDHmw3jA3v9rpqqxxzmCAd9Hs" | |
words = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"] | |
factory = AccountFactoryED25519('L') | |
def find_insert_word(): | |
print("Changing the position of each word") |