Skip to content

Instantly share code, notes, and snippets.

@ssrihari
ssrihari / clojure-learning-list.md
Last active May 3, 2024 12:57
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
@yogthos
yogthos / clojure-beginner.md
Last active April 29, 2024 10:56
Clojure beginner resources

Introductory resources

Getting Started with Clojure on Windows

Clojure is an amazingly powerful language. Using it (and watching Rich Hickey videos) has changed the way I think about programming, and the way I code in general. Once I learned the basics of the language, which was a relatively quick process, I fell in love and couldn't look back. I hope this post can help others who are new to Clojure get up and running quickly and painlessly.

This post is opinionated in the sense that I'll suggest certain tools to help those who are new to this scene get on their feet. The things you'll need are:

  • Leiningen (pronounced LINE-ing-en) - This is like a package manager, build tool, task manager, and more in one tool. Think npm or nuget, but with more capabilities. There is at least one other build tool for Clojure (boot), but Leiningen is the most widely used.
  • JDK - Clojure runs on Java. Throw out any qualms you may have about Java, we aren't coding in Java (though we can through Clojure, and sometimes tha
@fardjad
fardjad / how-to-install-homebrew-on-manjaro.md
Last active March 18, 2024 16:09
[How to Install Homebrew on Manjaro] Steps required to install homebrew on Manjaro Linux #linux #manjaro #homebrew
@bpringe
bpringe / Time.cs
Created December 12, 2018 22:10
Function to print time of operation and return result
public static T Time<T>(string op, Func<T> f)
{
var sw = Stopwatch.StartNew();
T result = f();
sw.Stop();
Console.WriteLine($"{op} took {sw.ElapsedMilliseconds} ms");
return result;
}
@elijahmanor
elijahmanor / pros-cons-npmscripts-vs-gulp.md
Last active February 20, 2022 12:46
Pros and Cons of `npm scripts` vs Gulp

Comparison of npm scripts vs Gulp

npm scripts

Pros

  • npm scripts are low-level and leverage the actual library you want to use (example: "lint": "eslint ./")
  • package.json is a central place to see what scripts are available (also npm run will list all scripts)
  • When things get too complicated you can always defer to another file (example: "complex-script": "babel-node tools/complex-script.js")
  • npm scripts are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)
@auremoser
auremoser / README.md
Created May 28, 2015 08:08
Github Issue Template

This template is my ideal format for issues submitted to a github repository.

@edw
edw / delete-recursively.clj
Last active November 12, 2021 20:31
To delete a directory recursively in Clojure.
(defn delete-recursively [fname]
(let [func (fn [func f]
(when (.isDirectory f)
(doseq [f2 (.listFiles f)]
(func func f2)))
(clojure.java.io/delete-file f))]
(func func (clojure.java.io/file fname))))
@jhickner
jhickner / 1.clj
Created April 14, 2012 07:00
hmac
(ns oauth.digest
(:import (javax.crypto Mac)
(javax.crypto.spec SecretKeySpec)))
(defn hmac
"Calculate HMAC signature for given data."
[^String key ^String data]
(let [hmac-sha1 "HmacSHA1"
signing-key (SecretKeySpec. (.getBytes key) hmac-sha1)
mac (doto (Mac/getInstance hmac-sha1) (.init signing-key))]
@ishikawa
ishikawa / gist:88599
Created April 1, 2009 07:49
Java Sample Code for Calculating HMAC-SHA1 Signatures
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.util.Formatter;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**