Skip to content

Instantly share code, notes, and snippets.

View velppa's full-sized avatar
🎯
Focusing

Pavel Popov velppa

🎯
Focusing
View GitHub Profile
@ssrihari
ssrihari / clojure-learning-list.md
Last active April 24, 2024 03:06
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
@sirn
sirn / README.md
Last active October 20, 2022 16:03
Gopls and the Rabbit Hole

Gopls and the Rabbit Hole

gopls v0.9.5 hangs when visiting a buffer when running under eglot under Mac GUI for some reason. Downgrading gopls to v0.9.4 make it works under eglot again. Naturally, I would assume this was a regression with gopls. git bisect indicates that the first "bad" commit was https://github.com/golang/tools/commit/cd31eaad03d53a18fa4b5e25b94d0b65e7380349, which means it should fail since v0.8.2, but for some reason installing via go install golang.org/x/tools/gopls@vX.Y.Z worked up to v0.9.4, even with go 1.19, and even v0.9.5 works fine when running under LSP client (Sublime Text).

In an attempt to find out if this code path was indeed an issue, I cloned the latest commit and attempt to stub out gopls/internal/vulncheck. Fortunately, this particular code were already stubbed out for go version older than 1.18, so removing this code was easy:

diff --git a/gopls/internal/vulncheck/command
@holyjak
holyjak / http-server.bb
Last active March 19, 2023 04:36
Babashka HTTP server for serving static files, similar to `python -m http.server` but more flexible :)
#!/usr/bin/env bb
#_" -*- mode: clojure; -*-"
;; Based on https://github.com/babashka/babashka/blob/master/examples/image_viewer.clj
(ns http-server
(:require [babashka.fs :as fs]
[clojure.java.browse :as browse]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[org.httpkit.server :as server]
@plroebuck
plroebuck / svg2icns.bash
Last active January 23, 2024 07:03
Create ICNS file from SVG file (with ImageMagick)
#! /bin/bash
###
### svg2icns.bash
### Create ICNS file from SVG
###
### See also:
### <https://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil#39678276>
### <https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html>
###
@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))
@abstractart
abstractart / books.md
Last active April 13, 2024 00:01
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@danielrw7
danielrw7 / replify
Last active October 24, 2023 12:03
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active April 27, 2024 08:07
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@manjuraj
manjuraj / scalaz-disjunction.scala
Last active November 12, 2018 16:15
scalaz disjunction
//
// Disjunction - aka Scalaz Either
// \/[A, B] is an alternative to Either[A, B]
// -\/ is Left (usually represents failure by convention)
// \/- is Right (usually represents success by convention)
// Left or Right - which side of the Disjunction does the "-" appear?
//
// Prefer infix notation to express Disjunction Type v: String \/ Double
//
// References