I hereby claim:
- I am mbuczko on github.
- I am mbuczko (https://keybase.io/mbuczko) on keybase.
- I have a public key whose fingerprint is 0639 2B57 8F68 B2F8 7CE9 861E EA1C F2EE 7389 EE0E
To claim this, I am signing this object:
:graphql-url = https://api.github.com/graphql | |
:github-token := (auth-source-pass-get "token" "web/github") | |
:headers = << | |
Authorization: Bearer :github-token | |
User-Agent: Emacs | |
# | |
:query-repos := << |
(require 'all-the-icons) | |
(defun with-faicon (icon str &optional height v-adjust) | |
(s-concat (all-the-icons-faicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str)) | |
(defun with-fileicon (icon str &optional height v-adjust) | |
(s-concat (all-the-icons-fileicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str)) | |
(defun with-octicon (icon str &optional height v-adjust) | |
(s-concat (all-the-icons-octicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str)) |
use rusqlite::{ToSql, types::{FromSql, FromSqlResult, ToSqlOutput, ValueRef}}; | |
use miniserde::{Deserialize, Serialize, de::Visitor, make_place, ser::Fragment}; | |
use miniserde::Result; | |
make_place!(Place); | |
#[derive(Serialize, Clone, Deserialize, Debug)] | |
pub struct DateTime( | |
pub time::OffsetDateTime | |
); |
function uuidv4() { | |
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => | |
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) | |
); | |
} | |
function lamportMutex(id) { | |
const X = '_lock-X', | |
Y = '_lock-Y'; |
(defn remote-req [result] | |
(Thread/sleep 1000) | |
result) | |
(defmacro plet [bindings & body] | |
(let [bents (partition 2 (destructure bindings)) | |
smap (into {} (map (fn [[b _]] | |
[b `(deref ~b)]) | |
bents)) | |
bindings (vec (mapcat (fn [[b v]] |
(defun flycheck-parse-cargo-rustc (output checker buffer) | |
"Parse Cargo errors from OUTPUT and return a list of `flycheck-error'. | |
CHECKER and BUFFER denote the CHECKER that returned OUTPUT and | |
the BUFFER that was checked respectively. | |
The expected format for OUTPUT is a mix of plain text lines and | |
JSON lines. This function ignores the plain text lines and | |
parses only JSON lines. Each JSON line is expected to be a JSON | |
object that represents a message from Cargo. The format of |
;; requires git-link package | |
(defun github--goto-issue-or-pr (id type) | |
"Opens a browser with issue or PR (denoted by TYPE) of given ID." | |
(let* ((origin-url (car (git-link--exec "config" "--get" "remote.origin.url"))) | |
(repo-match (string-match "^git@github.com:\\([^\\.]+\\)" origin-url)) | |
(repo-url (concat "https://github.com/" (match-string 1 origin-url))) | |
(sub-path (cond ((eq 'issue type) "/issues") | |
((eq 'pr type) "/pull")))) |
(pc/defresolver res-with-timeout [_ _] | |
{::pc/output [:foo]} | |
(async/go | |
(let [timeout-ch (async/timeout 3000) | |
[ch res] (async/alts!! [(async/go | |
(do-my-operation-here)) | |
timeout-ch] :priority true)] | |
(if (= ch timeout-ch) | |
(throw (ex-info "Resolver timeout" {:timeout 3000})) | |
res)))) |
(defmacro with-mock [vr & body] | |
`(with-redefs [~vr (with-meta | |
(fn [& ~'args] (swap! (-> ~vr meta :args) conj ~'args)) | |
{:args (atom [])})] | |
(do ~@body))) | |
(defmacro make-mock | |
([m] `(make-mock ~m nil)) | |
([m stub] |
I hereby claim:
To claim this, I am signing this object: