sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| ### Phel wrapping over WP / PHP API's | |
| ## TODO make a library some day.. | |
| (ns my-project\lib\wp | |
| (:require phel\str :as str) | |
| (:require phel\pdo :as pdo) | |
| (:require phel\pdo\statement :as statement)) | |
| ## Initialize WordPress plugin environment for REPL / tests | |
| (defn resolve-wp-load-path |
| # Some Phel utility fns / macros | |
| (ns my-project\utils) | |
| (defn parse-float | |
| "Converts to float without doing odd type conversions, acting more like | |
| Float/parseFloat in Clojure." | |
| [x] | |
| (when-not (php/is_numeric x) | |
| (throw (php/new \InvalidArgumentException | |
| (str "Invalid value for parse-float (" x ")")))) |
| -- Compile with -threaded | |
| import System.IO | |
| import Control.Concurrent | |
| getGreeting :: IO String | |
| getGreeting = do | |
| -- Get id and convert to string | |
| tid <- myThreadId | |
| let greeting = "Hello from " ++ show tid |
| <?php | |
| declare(strict_types=1); | |
| namespace Core\Domain\Time; | |
| use DateTimeImmutable; | |
| use DateTimeZone; | |
| use Generator; | |
| use Iterator; |
| import Data.List | |
| import Data.Char | |
| import System.IO | |
| getSearchWords :: IO [String] | |
| getSearchWords = do | |
| putStrLn "Specify the words to search:" | |
| aux | |
| where | |
| aux = do |
Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.
Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.
Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.
The book is build around 34 chapters organised in chapters.
| <?php | |
| class Foo { | |
| private $bar = "private variable 1"; | |
| private $bar2 = "private variable 2"; | |
| } | |
| $foo = new Foo; | |
| echo current($foo)."\n"; |