What the hell is an MCP server?
What do they have to do with LLMs?
Why would I want to use one and why is everyone talking about them?
| #!/bin/zsh | |
| # macOS Server Optimization Script | |
| # Disables unnecessary background processes and services for server use | |
| # Based on community research and tested configurations | |
| # WARNING: This script makes significant changes to your macOS system | |
| # Please read through and understand each section before running | |
| # Test in a non-production environment first |
| #!/bin/bash | |
| # Improved Mac Setup Script - Idempotent and Modular | |
| # This script sets up a new Mac development environment with proper error handling | |
| # and idempotency checks. | |
| # | |
| # # Download | |
| # curl ~~Get gist raw url~~ > setup.sh | |
| # chmod +x ~/setup.sh | |
| # ~/setup.sh |
| -- This function will do a global search through a Postgres database. | |
| CREATE OR REPLACE FUNCTION search_columns( | |
| needle text, | |
| haystack_tables name[] default '{}', | |
| haystack_schema name[] default '{}' | |
| ) | |
| RETURNS table(schemaname text, tablename text, columnname text, rowctid text) | |
| AS $$ | |
| begin |
| -- This will query your Postgres DB, and generate MermaidJs formatted ERD | |
| SELECT 'erDiagram' | |
| UNION ALL | |
| SELECT | |
| format(E'%s { %s\n}', | |
| c.relname, | |
| string_agg( | |
| format(E'\n %s %s', | |
| REPLACE( |
Rewrite this function to be as succinct as possible! (Hint: One function needed and an In-Fix Operator)
(a, b) => doStuff(_ => a, b)
Yoneda (and its duel Coyoneda) is well known in the Category Theory field and has been ported over to functional languages such as Haskell. Each have their uses - sometimes in similar scenarios, also in very different ways.
This will be a newbie's explanation of the concept, using Haskell to illustrate, without any Category Theory.
From what I've read, the Yonedas are not 'daily-drivers' (not used everyday), but rather can be pulled out when the time is right.
Uses: Both Yoneda's can be used to help speed up a program where there are many fmap with long lists or big trees involved. Coyoneda can be used if you want to create an 'interface' and build up calculations, then pass those calculations to an 'executor' to run them.
| compose :: | |
| Lens b c -> | |
| Lens a b -> | |
| Lens a c | |
| compose (Lens g) (Lens f) = | |
| Lens | |
| ( \a -> | |
| let Store s2 g2 = f a | |
| Store s3 g3 = g g2 | |
| in Store (s2 . s3) g3 |
| data BinaryTree3 v a | |
| = Node3 v a (BinaryTree3 v a) (BinaryTree3 v a) | |
| | Leaf3 v a | |
| deriving (Show) | |
| -- Node3 (Node3 0 False (Node3 1 False (Leaf3 3 False) (Leaf3 4 False)) (Leaf3 2 True)) False | |
| -- (Node3 (Node3 1 False (Leaf3 3 False) (Leaf3 4 False)) False | |
| -- (Leaf3 (Leaf3 3 False) False) | |
| -- (Leaf3 (Leaf3 4 False) False)) | |
| -- (Leaf3 (Leaf3 2 True) True) |
| -- duplicate $ ListZipper (2:.1:.Nil) 3 (4:.5:.Nil) | |
| -- [[1] >2< [3,4,5],[] >1< [2,3,4,5]] >[2,1] >3< [4,5]< [[3,2,1] >4< [5],[4,3,2,1] >5< []] | |
| -- data ListZipper a = ListZipper [a] a [a] | |
| duplicate :: ListZipper a -> ListZipper (ListZipper a) | |
| duplicate z@(ListZipper l i r) = | |
| let moveLeft (x :. xs) i rs = ListZipper xs x (i :. rs) :. moveLeft xs x (i :. rs) | |
| moveLeft Nil _ _ = Nil | |
| moveRight ls i (x :. xs) = ListZipper (i :. ls) x xs :. moveRight (i :. ls) x xs | |
| moveRight _ _ Nil = Nil |