sorted by: new top controversial old
[-] pkill@programming.dev 2 points 2 weeks ago

Somewhat useful with (neo)vim, where it's (however tiny af) context window spans every open buffer

[-] pkill@programming.dev 2 points 2 weeks ago

Notesnook ftw

[-] pkill@programming.dev 1 points 2 weeks ago

https://altcha.org is nice plus a crowdsec bouncer

[-] pkill@programming.dev 2 points 3 weeks ago* (last edited 3 weeks ago)

In Clojure, -> is used for inserting the piped argument at the head position in the arguments of whatever it is passed to, while ->> is used for inserting it at the tail. This approach is great for working with immutable data in a series of approachable transformations, which I believe is one reason why so many Domain-Specific Languages for generative programming are written in that language, aside from its interactive REPL. Additionally, there is no need to worry about excessive copying, as this is generally well optimized.

This can be particularly useful with HoneySQL, which is more of a DSL for SQL rather than a typical ORM tool. For example:

(defn apply-filters [query filters]
"applies WHERE clauses to a query"
  (reduce (fn [q [column value]]
            (helpers/where q [:= column value]))
          query
          filters))

(defn build-dynamic-query [{:keys [table columns filters sort-by limit]}]
  (-> {}
      (helpers/select columns)
      (helpers/from table)
      (apply-filters filters)
      (helpers/order-by sort-by)
      (helpers/limit limit)
      sql/format))

;; Result - a super readable function call that resembles a natural language 
(build-dynamic-query 
  {:table :products 
   :columns [:id :name :price] 
   :filters {:category "electronics" :in-stock true}
   :sort-by [:price :desc]
   :limit 20})
[-] pkill@programming.dev 1 points 3 weeks ago

Lenin was 47 in 1917

[-] pkill@programming.dev 2 points 3 weeks ago

(\r (frequencies "strawberry"))

[-] pkill@programming.dev 4 points 3 weeks ago

the 'I' in LLM stands for intelligence

[-] pkill@programming.dev 2 points 1 month ago

lots of onions cut in rings as they resemble parentheses the most

[-] pkill@programming.dev 10 points 1 month ago

death by specificity is a thing...
HTTPServletRequest has a fuckton of methods but 90% of them could be eliminated if one treated the data as a simple fucking map instead of creating 4 methods for each key in every record of your schemas.

[-] pkill@programming.dev 8 points 1 month ago

personally I'd sum it up this way: it is usually enough to abstract two parts of your code: the repetitive stuff and the stuff that can be separated from external dependencies like db or network. That should be enough to ensure readability and that you can test it properly and not have to deal with rewriting half your codebase when you decide to change an external dependency.

[-] pkill@programming.dev 3 points 1 month ago

Funny how he is actually now a fan of Clojure yet the examples in his book are actually full of mutating data and side effects. And Rich Hickey also stressed that tests are no silver bullet.

509
low effort maymay (programming.dev)

Alt text: O'RLY? generated book cover with a donkey, navy blue accent, header: "It's only free if you don't value your time", title: "Handling Arch Linux Failures", subtitle: "Mom, please cancel my today's agenda!"

262
submitted 3 months ago* (last edited 3 months ago) by pkill@programming.dev to c/programmer_humor@programming.dev

...from people who seem to refuse to install paredit or coloring plugins for either? ps lisp syntax ftw, it's a feature!

46
submitted 5 months ago* (last edited 5 months ago) by pkill@programming.dev to c/programmer_humor@programming.dev

Alternative links: YT Tubo Invidious Piped 0 Piped 1

47

As in title. Do you know any good alternative i2p trackers?

view more: next ›

pkill

joined 1 year ago