Skip to content

Instantly share code, notes, and snippets.

View jwhitlark's full-sized avatar

Jason Whitlark jwhitlark

View GitHub Profile
@mandrean
mandrean / install-pulseview-gettext-macos
Created January 23, 2023 17:29
Install PulseView (& gettext) on Apple M1 Silicon (aarch64, arm64)
# install xcodes
brew install robotsandpencils/made/xcodes aria2
# install & select latest version of xcode
xcodes list | awk 'END{system("xcodes install " $1"; xcodes select " $1)}'
# install x86-64 homebrew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# switch to x86_64 homebrew
@mihai-dinculescu
mihai-dinculescu / 01-build.rs
Last active September 4, 2024 17:48
ESP32-MQTT-Rust
// build.rs
use embuild::build::LinkArgs;
fn main() -> anyhow::Result<()> {
// Necessary because of this issue: https://github.com/rust-lang/cargo/issues/9641
LinkArgs::output_propagated("ESP_IDF")?;
Ok(())
}
@mattmc3
mattmc3 / tasks.json
Created April 6, 2017 00:44
VSCode tasks for running a Makefile
// Makefile
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "0.1.0",
"command": "bash",
@angusiguess
angusiguess / biblio.md
Last active May 6, 2023 21:52
Emulators, Immutability, and Time Travel
@arohner
arohner / google-api.clj
Created November 5, 2016 21:53
Clojure example of accessing google APIs directly
(ns example.api.google
(:require [cemerick.url :as url]
[cheshire.core :as json]
[clj-jwt.core :as jwt]
[clj-jwt.key :as key]
[clj-time.core :as time]
[clj-http.client :as http]
[clojure.string :as str])
(:import java.io.StringReader))
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@danlentz
danlentz / flow-diagram.clj
Created February 26, 2014 06:53
Clojure ASCII flow diagrams from google code
;;;;;;;;;;;;;;;;;;
;; $Rev$
;; textflow is a trivial generator of RFC like call flow (a.k.a sequence diagrams)
;;
;; Example usage:
;; (flow [Alice Bob Tzach]
;; [[mmm Tzach Bob]
;; [xxx Bob Alice]
;; []
;; [zzz Alice Tzach]])
@bbbates
bbbates / core.clj
Created January 3, 2014 03:15
Using LockService to guarantee leader with Clojure and JGroups
(ns leader-guarantee.core
(:import (org.jgroups.blocks.locking LockService)
(org.jgroups.protocols CENTRAL_LOCK)
(org.jgroups JChannel)
(java.util.concurrent.locks Lock)))
(defn- get-lock
[lock-service with-lock-fn]
(fn []
(let [lock (.getLock lock-service "leader")]
@xavi
xavi / gist:3729307
Created September 15, 2012 18:57
Fast, simple, powerful templating in Clojure
;; Call the renderer-fn macro with a template and it returns a function optimized to render it.
;; This happens at compile-time.
;; At run-time, you call this function with the parameters that will be interpolated into the template,
;; typically (but not limited to) a map.
;;
;; Useful in i18n for variable interpolation, for example. I'm using this to add internationalization
;; support to https://github.com/xavi/noir-auth-app
;; See usage at the end.