Skip to content

Instantly share code, notes, and snippets.

View frankitox's full-sized avatar

Franco Biasin frankitox

  • Rosario, Argentina
View GitHub Profile
@roman01la
roman01la / analyze.clj
Created March 18, 2021 01:42
analyzing unused and undefined re-frame subscriptions via clj-kondo
(ns analyze.core
(:require [clj-kondo.core :as clj-kondo]
[clojure.set :as set]))
;; checks re-frame's :<- syntax
;; to mark dependency subscriptions as used
(def analyze-reg-sub
"(require '[clj-kondo.hooks-api :as api])
(fn [{node :node}]
(let [[_ kw & children] (:children node)
@lukaszkorecki
lukaszkorecki / Dockerfile
Created February 17, 2021 17:04
AWS Lambda + babashka + minimal container image
FROM alpine:3.11.3
RUN apk update && apk add curl ca-certificates unzip && rm -rf /var/cache/apk/*
RUN curl -L 'https://github.com/babashka/babashka/releases/download/v0.2.10/babashka-0.2.10-linux-static-amd64.zip' -o /tmp/bb.zip && \
unzip /tmp/bb.zip && \
mv bb /usr/bin/bb && \
chmod +x /usr/bin/bb
RUN mkdir -p /app
@yogthos
yogthos / clojure-beginner.md
Last active April 15, 2024 17:11
Clojure beginner resources

Introductory resources

@gusbicalho
gusbicalho / start-here-you-are-not-so-smart.md
Last active November 11, 2022 14:49
A roadmap of interesting books

START HERE: You are not so smart

I recomend reading at least two of the above.

If you feel like you know enough about how your mind is fucked-up miscalibrated, you can move on to the lists below. Each one has a few sublists. The order of the sublists does not matter. For each sublist, the first link is the one I see as a good starting point, but the order does not matter too much, either.

@ericnormand
ericnormand / 00_script.clj
Last active January 6, 2024 07:13
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@thegeez
thegeez / spec_parsing.clj
Last active December 30, 2023 18:17
Parsing with clojure.spec for the Advent of Code challenge
(ns net.thegeez.advent.spec-parsing
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :as tgen]))
;; Dependencies:
;; [org.clojure/clojure "1.9.0-alpha14"]
;; [org.clojure/test.check "0.9.0"]
;; Advent of Code is a series of code challenges in the form of an advent
@lfn3
lfn3 / core.clj
Created August 29, 2016 20:47
Validating values put into a channel with clojure spec
(ns channel-of.core
(:require [clojure.spec :as s]
[clojure.core.async :as a]
[clojure.core.async.impl.protocols :as ap]))
(defmacro chan-of [spec & chan-args]
`(let [ch# (a/chan ~@chan-args)]
(reify
ap/ReadPort
(take! [_ fn1-handler#]
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active April 10, 2024 21:00
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on