Skip to content

Instantly share code, notes, and snippets.

View mvarela's full-sized avatar
💭
The forecast is hacky, with high chance of parenthesis

Martín Varela mvarela

💭
The forecast is hacky, with high chance of parenthesis
View GitHub Profile
@ssrihari
ssrihari / clojure-learning-list.md
Last active May 6, 2024 16:25
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@baskeboler
baskeboler / clipboard.clj
Last active April 11, 2021 01:21 — forked from brake/clipboard.clj
Write pretty printed Clojure data structures to the clipboard
(ns clipboard.core
(:require [fipp.edn :as fipp])
(:import (java.awt.datatransfer DataFlavor Transferable StringSelection)
(java.awt Toolkit)
(java.io StringWriter))
(defn get-clipboard
"get system clipboard"
[]
(-> (Toolkit/getDefaultToolkit)
@malcolmsparks
malcolmsparks / backup-photos.clj
Last active June 29, 2021 19:10
A babashka script for sorting and de-duping a photo collection on Linux.
#_( ;; Allow this script to be executed directly
"exec" "bb" -o "--classpath" "." "$0" "$@"
)
;; Copyright © 2020, Malcolm Sparks
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the “Software”), to deal
;; in the Software without restriction, including without limitation the rights
;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

React Native + macOS + Clojurescript

image

Project Catalyst

Since the recent release of Catalina, macOS has shipped with the ability to allow iOS/iPAD apps to run on macOS without any modification via a featureset known as Project Catalyst.

This is exciting, as writing React Native + Clojurescript apps as a target for the desktop is much more compelling than a pure Electron app (imo).

@pjstadig
pjstadig / transducers.md
Last active June 8, 2021 13:22
The secret feature of transducers that no one talks about!

The Pledge

One thing that always made me a little sad about transducers was how map lost its ability to iterate multiple collections in parallel. This is actually my favorite feature of map. For example:

(map + (range 5) (range 5 10))
=> (5 7 9 11 13)

One somewhat practical use of this is if you want to compare two sequences, pairwise, using a comparator. Though I wish that every? took multiple collections, this is an adequate substitute:

How Clojure's documentation can leapfrog other languages

Summary

I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.

The Problem

Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."

@borkdude
borkdude / text_xform.clj
Created September 1, 2017 13:07
Clojure text files transducer
(ns text-xform
(:require [clojure.java.io :as io]
[clojure.string :as str]
[cheshire.core :as json])
(:import [java.io BufferedReader]))
;;;; inspired by https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure
(def db (atom 0))
@Airblader
Airblader / make_dock.sh
Created May 9, 2017 09:44
Turn any window into a dock for i3 (caution, dock windows do not take focus ever)
#!/usr/bin/env bash
# call like this:
# /path/to/this/script.sh <window_id> <dock height>
win="${1:-}"
height="${2:-}"
width=$(xrandr -q | head -n1 | awk '{print $8}')
xdotool windowunmap --sync ${win}
xdotool windowsize --sync ${win} ${width} ${height}
@jjmalina
jjmalina / debian-8-jessie-lenovo-x1-carbon-4th-gen.md
Last active July 6, 2021 17:45
Installing Debian 8.5 "jessie" on a Lenovo X1 Carbon 4th generation

Installing Debian 8.5 "jessie" on a Lenovo X1 Carbon 4th generation (20FB) - 2016

UPDATE 2018-02-24: I got a new Lenovo X1 Carbon 5th gen and tried to do the same setup with Debian 9.3.0. It was an utter failure because of some boot issues. I went with Xubuntu instead and everything works FLAWLESSLY. Xubuntu is beautiful.

I've had my mind on switching my development machine from a 13" MacBook Pro Retina to a Lenovo X1 Carbon running Linux for a while. The main reason is getting more familiar with Linux itself and also to have a more stable and minimal dev environment. So I finally got the machine and decided to install Debian 8.5 "jessie". Why Debian? Well, I tried installing Arch Linux once and couldn't get past getting wifi to work, and Ubuntu seemed like it added too much stuff. The choice was either Debian or Linux Mint. I went with Debian because it seems like it's the most stable.

Create a bootable USB stick

I followed the instructions at https://www.debian.org/releases/jessie/amd64/ch04s

@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links