𝛌_____𝛌
( o o )
( =𝛌= )
( )
( )
( )))))))))))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns enjure.router.internal.radix-tree | |
(:require [clojure.string :as string]) | |
(:require [clojure.pprint :refer [pprint]])) | |
(defn ->prefixtree | |
"Creates a prefix (radix) tree root" | |
[data prefix] | |
{:children prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TrieNode() { | |
this.children = {}; | |
this.endOfWord = false; | |
} | |
function Trie() { | |
this.root = new TrieNode(); | |
} | |
Trie.prototype.insert = function (word) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojure-playground.trie3 | |
(:require [clojure.pprint :refer [pprint]]) | |
(:require [clojure.test :refer [is]])) | |
(defn insert-str-in-trie | |
[trie the-string] | |
(let [str-seq (map str the-string)] | |
(loop [remaining-chars str-seq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl enable ssht | |
systemctl start ssht | |
# Status | |
systemctl status ssht |
save images as tar.gz
:
docker save <image_name_1> <image_name_2> | gzip > images.tgz
then restore images (e.g on a target system):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
alias pc4=proxychains4 | |
##### | |
git_incremental_clone() | |
{ | |
REPO=$1 | |
DIR=$2 | |
git clone --recurse-submodules $REPO $DIR --depth=1 | |
cd $DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @snippet.laravel | |
class Minifier | |
{ | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @snippet.reflection | |
public static function getMethodSource(\ReflectionMethod $method): string | |
{ | |
$path = $method->getFileName(); | |
$lines = @file($path); | |
$from = $method->getStartLine(); | |
$to = $method->getEndLine(); | |
$len = $to - $from + 1; | |
return implode(array_slice($lines, $from - 1, $len)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @snippet.reflection | |
function get_func_body($func,$print=false){ | |
$func = new \ReflectionFunction($func); | |
$filename = $func->getFileName(); | |
$start_line = $func->getStartLine() - 1; // it's actually - 1, otherwise you wont get the function() block | |
$end_line = $func->getEndLine(); | |
$length = $end_line - $start_line; | |
$source = file($filename); |
NewerOlder