pkill

joined 1 year ago
[–] pkill 2 points 2 months ago

Notesnook ftw

[–] pkill 1 points 2 months ago

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

[–] pkill 10 points 2 months ago

Meta or microshit would fill the market gap then...

[–] pkill 2 points 2 months ago* (last edited 2 months 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 1 points 3 months ago (1 children)

Lenin was 47 in 1917

[–] pkill 2 points 3 months ago

(\r (frequencies "strawberry"))

[–] pkill 4 points 3 months ago

the 'I' in LLM stands for intelligence

[–] pkill 2 points 3 months ago (1 children)

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

[–] pkill 1 points 3 months ago

I did not really mean that out of the box there would be incompatibilities, more likely within unsafe blocks and external crates

[–] pkill 15 points 3 months ago* (last edited 3 months ago) (2 children)

Anything that can run C++ should be able to run Rust if you use the LLVM backend, perhaps except when a watch uses musl libc and you rely on some glibc-only call in your program. afaik the only physical devices shipping with musl are car infotainment systems based on l4 kernels and networking hardware (OpenWRT).

view more: ‹ prev next ›