Skip to content

Instantly share code, notes, and snippets.

View ga2arch's full-sized avatar
🐢

Gabriele Carrettoni ga2arch

🐢
View GitHub Profile
@ga2arch
ga2arch / gist:6ede688266a24c5714ae5b67c0b19640
Created June 14, 2021 22:13 — forked from d-t-w/gist:a239dfca4f57b7ff6f38c895b7f45405
Intellij Cursive+Cljfmt Editor CodeStyle
<code_scheme name="TW" version="173">
<ClojureCodeStyleSettings>{
:cljs.core/as-&gt; :only-indent
:cljs.core/assoc 0
:cljs.core/cond-&gt; :only-indent
:cljs.core/cond-&gt;&gt; :only-indent
:cljs.core/defonce :only-indent
:cljs.core/with-meta :only-indent
:cljs.core.async/go :only-indent
:cljs.core.async/go-loop :only-indent

gabriele.carrettoni@gmail.com | +393935167969 | github | linkedin

Gabriele Carrettoni – Backend Software Engineer

  • 6+ years of experience as a Software Engineer
  • 4+ years backend experience with microservice event-driven architecture on AWS
  • 2+ years of experience with actor-based architecture

Skills

@ga2arch
ga2arch / core.clj
Last active March 26, 2018 20:55
gitdb
(ns core
(:require [clj-jgit.porcelain :as git]
[clj-jgit.querying :refer :all]
[clj-jgit.internal :refer [new-rev-walk]]
[clojure.set :refer [rename-keys]]
[datascript.core :as d]
[clojure.pprint :as pp])
(:import (org.eclipse.jgit.internal.storage.file RefDirectory$LooseUnpeeled)))
(defn branch->map
(defn crete-persistent-conn
[schema]
(letfn [(read-file [source]
(with-open [r (PushbackReader. (jio/reader source))]
(edn/read
{:readers {'datascript/DB (fn [{:keys [datoms schema]}]
(db/init-db (mapv #(apply db/datom %) datoms) schema))}}
r)))
(write-file [filepath data]
(with-open [w (jio/writer filepath)]
@ga2arch
ga2arch / deps.edn
Last active March 26, 2018 15:28
train alert
{:paths ["."]
:deps {falcon {:mvn/version "0.1.0"}}}
\d .q
/each: +-*%&|^<>=$ <= >= <> @ ? in within bin div abs log exp sqrt sin cos tan f' f\: f/:
neg:-:;not:~:;null:^:;string:$:;reciprocal:%:;floor:_:;ceiling:-_-:;signum:{(x>0)-x<0}
mod:{x-y*x div y};xbar:{x*y div x:$[16h=abs[@x];"j"$x;x]};xlog:{log[y]%log x};and:&;or:|;each:{x'y};scan:{x\y};over:{x/y};prior:{x':y}
mmu:$;lsq:!;inv:!:;md5:-15!;ltime:%:;gtime:{t+x-%t:x+x-%x}; /xnull:{$[0>@y;(,y)@~x=y;x=y;y 0N;y]}
/aggr: last sum prd min max avg wsum wavg f/ /beta:{cov[x;y]%var x}
count:#:;first:*:;svar:{(n*var x)%-1+n:(#x)-+/^x};sdev:{sqrt svar x};scov:{(n*cov[x;y])%-1+n:(#x)-+/^x+y};med:{avg x(<x)@_.5*-1 0+#x,:()};all:min"b"$;any:max"b"$;rand:{*1?x}
/unif: f': f\
(setq inhibit-startup-message t)
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("org" . "http://orgmode.org/elpa/")
("emacs-pe" . "https://emacs-pe.github.io/packages/")))
@ga2arch
ga2arch / gist:8fdc68bad3794bd1e540d9bb59de3a47
Created April 10, 2016 21:17 — forked from patshaughnessy/gist:70519495343412504686
How to Debug Postgres using LLDB on a Mac
This note explains how to build Postgres from source and setup to debug it using LLDB on a Mac. I used this technique to research this article:
http://patshaughnessy.net/2014/10/13/following-a-select-statement-through-postgres-internals
1. Shut down existing postgres if necessary - you don’t want to mess up your existing DB or work :)
$ ps aux | grep postgres
pat 456 0.0 0.0 2503812 828 ?? Ss Sun10AM 0:11.59 postgres: stats collector process
pat 455 0.0 0.0 2649692 2536 ?? Ss Sun10AM 0:05.00 postgres: autovacuum launcher process
pat 454 0.0 0.0 2640476 304 ?? Ss Sun10AM 0:00.74 postgres: wal writer process
pat 453 0.0 0.0 2640476 336 ?? Ss Sun10AM 0:00.76 postgres: writer process
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Prelude hiding (log)
--------------------------------------------------------------------------------
-- The API for cloud files.
class Monad m => MonadCloud m where
saveFile :: Path -> Bytes -> m ()
import asyncio
from socket import socketpair
store = []
async def handler(reader, writer):
while True:
try:
data = await reader.readline()
print(data)