Skip to content

Instantly share code, notes, and snippets.

View borkdude's full-sized avatar

Michiel Borkent borkdude

View GitHub Profile
@yogthos
yogthos / README.md
Last active March 24, 2024 10:35
command line util for grabbing current weather for a city using OpenWeather API

usage

Create an account at https://openweathermap.org and get an API key. Note that it can take up to a couple of hours for the key to become active. Add an environment variable OPEN_WEATHER_API_KEY with the value of the key.

run the script:

./weather.clj Toronto,CA

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).

@bmhatfield
bmhatfield / .zshrc
Last active March 7, 2024 23:11
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@KGOH
KGOH / convert.clj
Last active February 29, 2024 12:12
convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
#!/usr/bin/env bb
;; convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
;; Author: github.com/KGOH/
;; Source: gist.github.com/KGOH/50c0f66022fea2ac173518a143238058
;; Version: 2020.4
; Usage example:
; In Emacs: i.imgur.com/TIEDmga.mp4
; $ convert.clj edn <<< '{"foo": "bar"}'
; {:foo "bar"}
@adam-james-v
adam-james-v / ob-babashka.el
Last active February 8, 2024 16:25
a quick change of ob-clojurescript to try use Babashka.
;;; ob-babashka.el --- org-babel functions for ClojureScript evaluation -*- lexical-binding: t; -*-
;; Author: Adam James Vermeer
;; Maintainer: Adam James Vermeer
;; Created: 25 June 2021
;; Keywords: literate programming, reproducible research, babashka, clojure, scripting
;; Homepage: https://gist.github.com/adam-james-v/f4d2b75a70b095d14a351a1eff96b4b0
;; Package-Requires: ((emacs "24.4") (org "9.0"))
;; This file is modified from [[https://github.com/emacsmirror/ob-clojurescript/blob/master/ob-clojurescript.el][ob-clojurescript]]
@jackrusher
jackrusher / deploy.sh
Created January 17, 2022 15:22
Writing and deploying Google Cloud Functions in Clojure using NBB
# command line to deploy the project
gcloud functions deploy hello --runtime nodejs14 --trigger-http
@mukel
mukel / DynamicJava.java
Created June 14, 2021 20:45
Compiling Java code dynamically and running it in Espresso.
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;
@idleberg
idleberg / DropboxIgnore.md
Last active June 4, 2023 12:02
Ignore node_modules/bower_components folders in your Dropbox

This script scans your Dropbox (or any given folder) for folders stored in the ignore array and excludes them from syncing. Makes use of the official Dropbox CLI

I'm a beginner at bash, so all improvements are welcome!

#!/bin/bash

set -e

# SETTINGS
@methylene
methylene / murmur.clj
Last active March 26, 2023 17:25
murmur hash in clojure
(def murmur
(let [m (com.google.common.hash.Hashing/murmur3_128)]
(fn ^Long [^String s]
(-> (doto (.newHasher m)
(.putString s com.google.common.base.Charsets/UTF_8))
(.hash)
(.asLong)))))
@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)