Skip to content

Instantly share code, notes, and snippets.

View andradefil's full-sized avatar
😃
Hi there!

Filipe Andrade andradefil

😃
Hi there!
View GitHub Profile
@andradefil
andradefil / fil.sh
Created October 20, 2025 13:43
Fil was here
printf '\x46\x49\x4c\x20\x57\x41\x53\x20\x48\x45\x52\x45'
@andradefil
andradefil / dns.clj
Created October 20, 2025 13:19
Raw dns resolution in Clojure
(import '[java.net DatagramSocket DatagramPacket InetAddress])
(def query
(byte-array
[(byte 0x12) (byte 0x34) (byte 0x01) (byte 0x00)
(byte 0x00) (byte 0x01) (byte 0x00) (byte 0x00)
(byte 0x00) (byte 0x00) (byte 0x00) (byte 0x00)
(byte 0x07) (byte \c) (byte \l) (byte \o)
(byte \j) (byte \u) (byte \r) (byte \e)
(byte 0x03) (byte \o) (byte \r) (byte \g)
@andradefil
andradefil / server.clj
Created October 15, 2025 23:42
Serve a Static Clojure Website
(require '[org.httpkit.server :as server]
'[hiccup2.core :as h])
(def content
(str (h/html
[:meta {:charset "UTF-8"}]
[:head
[:script {:src "https://livejs.com/live.js" :type "text/javascript"}]]
[:body {:style {:background-color :black, :text-align :center}}
[:img {:src "https://github.com/clojurehackers/website/blob/main/assets/logo.jpg?raw=true", :align :center}]
@andradefil
andradefil / morse.clj
Last active October 10, 2025 23:30
Eval and Inspect With Morse Sub Repl
(require '[dev.nu.morse :as morse]
'[clojure.main :as main])
(morse/launch-in-proc)
(main/repl
:eval
(fn [form]
(eval form)
(morse/inspect form)))
@andradefil
andradefil / gist:951a0320f35879e95193123d5bfb87c7
Last active February 22, 2024 16:51
Datomic restore parameters string
;; Given a set of configuration for restore, and a restore function
;; returns the restore parameters string to be used
;; System Parameters
;; config a (baseline) config b(100x more) config c(500x more)
;; ##############################################################################################
;; datomic.s3BackupConcurrency 25 2500 12500
;; datomic.backupBranchConcurrency 32 3200 16000
;; datomic.writeConcurrency 4 400 2000
@andradefil
andradefil / local-import-attribute.clj
Created September 19, 2023 13:29
Datomic Dev Local Import Attribute
(require '[datomic.client.api :as d])
(require '[datomic.local :as dl])
(def client (d/client {:server-type :datomic-local
:system "dev"}))
(def db-name "test-uri-db")
(d/create-database client {:db-name db-name})
(def conn (d/connect client {:db-name db-name}))
(d/transact conn {:tx-data [{:db/ident :uri/full-uri
@andradefil
andradefil / read-all-monday-inbox.js
Created November 30, 2020 13:18
Monday Read All Items inbox
setInterval(() => {
$('.post_box .toggle-update-button .v-icon').map((k, v) => { v.click() })
}, 1000)
if (options && options.component) {
instance.$slots.default = instance.$createElement(options.component, {
props: options.props,
});
}
instance.$mount(`#${refId}`);
instance.$on('onClose', this.close);