Skip to content

Instantly share code, notes, and snippets.

View tiagodalloca's full-sized avatar
🤖

Tiago Dall'Oca tiagodalloca

🤖
View GitHub Profile
@realgenekim
realgenekim / README.md
Last active July 21, 2023 14:29
How to download all Clojure dependencies using clj (equivalent to "lein deps")

I recently had to figure out for a Clojure application how to download all dependency JAR files, for use in a Docker container.

When creating an uberjar, depstar re-downloaded all the external dependencies from Maven central, even though in an earlier Docker build step, I ran clj -Spath to pre-download them (presumably cached into the .m2 directory). In the past, I've used lein deps to do something similiar.

I'm grateful for Sean Corfield helping out (again!!): In short, use clj -P (short for "prepare") to download dependencies. Note the "A:depstar" option, which ensures that the depstar dependencies are downloaded, too.

Here's what it looks like in a Dockerfile:

# to pre-download dependencies, only done if deps.edn changes

State of Clojure Survey 2018 - Open comment question

This is a selection of the most articulated critique found in the open comments section Q25 at the bottom of the survey. Recurring themes are:

  1. Elitism, ivory tower, "not smart enough to get it" attitude of frequent speaker or early adopters.
  2. Poor basic documentation, error messages, beginner friendly resources.
  3. Fear of contribution (with reasons like a. community-built tools open to attack and replacement by core team b. hostile contribution environment c. closed development process)
  • The community has to grow to create more opportunities. Many organizations don't want to even consider using it because they fear not being able to find Clojure developers. Unless you have a mentor or are extremely motivated, Clojure scares away most imperative developers. My suggestions is to team up with a university and get a Clojure course on Coursera or a similar platform. This is the only way I got in
@bhb
bhb / blockchain-w-spec.md
Last active July 1, 2022 11:24
Building a blockchain, assisted by Clojure spec

Building a blockchain, assisted by Clojure spec

In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.

This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.

This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!

You don't need to know or care about blockchains to understand the code be

@jakewarren
jakewarren / Description.md
Last active January 11, 2024 02:33
Restrict the amount of CPU and memory resources that Chrome can consume.

Restrict the amount of CPU and memory resources that Chrome can consume.

Tested on Ubuntu 16.04/Linux Mint 18.


Install cgroups:

sudo apt install cgroup-bin
@tiagodalloca
tiagodalloca / led.py
Created October 3, 2017 14:07
Traz o led que pisca
import RPi.GPIO as gpio
import time
gpio.setmode(gpio.BCM)
gpio.setup(17, gpio.OUT)
gpio.setup(18, gpio.OUT)
gpio.setup(22, gpio.OUT)
gpio.setup(23, gpio.OUT)
gpio.setup(24, gpio.OUT)
@bhb
bhb / filter_spec.clj
Last active November 1, 2017 07:16
Adding your own spec for filter
(require '[clojure.spec.test.alpha :as st])
(require '[clojure.spec.alpha :as s])
(require '[expound.alpha :as expound])
(set! s/*explain-out* expound/printer)
(st/instrument)
(filter 123 "12333333333333") ; java.lang.Long cannot be cast to clojure.lang.IFn
(s/fdef clojure.core/filter
section .text
global _start
_start:
; mov edx, msg_len
; mov ecx, msg
; mov ebx, 1
; mov eax, 4
; int 0x80
; mov eax,3 ;instrucao para ler
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->