Skip to content

Instantly share code, notes, and snippets.

View peterschwarz's full-sized avatar

Peter Schwarz peterschwarz

View GitHub Profile
@aludvik
aludvik / sawtooth_docker_rust.md
Created September 19, 2018 15:54
Saving time using Rust and Docker with Sawtooth

This guide will help you save time building Sawtooth Core using the official development build tooling.

Prerequisites:

  • You have docker installed and setup
  • You have already built the docker image you are using, I use sawtooth-validator as an example, but this works with other docker containers that build Rust code
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@olivergeorge
olivergeorge / db-spec.clj
Last active September 24, 2021 12:55
Simple script to generate clojure.spec info for a database.
(ns db-spec.core
(:require [clojure.java.jdbc :as j]
[clojure.spec :as s])
(:import (java.sql Types)))
(defn db-tables-raw
[db-spec {:keys [catalog schemaPattern tableNamePattern]}]
(j/with-db-metadata [meta db-spec]
(j/metadata-result
(.getTables meta catalog schemaPattern tableNamePattern (into-array String ["TABLE"])))))
@rauhs
rauhs / Makefile
Last active July 7, 2020 19:44
Compiling clojurescript + figwheel without boot nor leiningen. Using leiningen to manage dependencies. Print file size stats (raw, gzip, brotli) for production builds
CLJ_NREPL_PORT:=22340
FIGWHEEL_PORT:=22345
CLJS_JAR_VERSION:=1.7.48
CLJS_JAR_URL:=https://github.com/clojure/clojurescript/releases/download/r$(CLJS_JAR_VERSION)/cljs.jar
.PHONY: def_target
def_target : null
@sander
sander / figwheel.clj
Created June 27, 2015 09:41
figwheel without leiningen, requires a figwheel-sidecar dependency
(require '[figwheel-sidecar.repl-api :as repl])
(def config
{:figwheel-options {}
:build-ids ["browser"]
:all-builds [{:id "browser"
:source-paths ["src/" "env/browser/"]
:figwheel {:on-jsload "id.client/main"}
:compiler {:output-to "public/js/app.js"
:output-dir "public/js"
@wiseman
wiseman / party-planner.cljs
Last active November 29, 2019 03:17
Party Planner
(ns party-planner
"A. K. Dewdney-style party simulation. Each guest has an ideal
distance from each other guest that they want to achieve.
From Scientific American, September 1987: 'Computer Recreations:
Diverse personalities search for social equilibrium at a computer
party.'"
(:use [enchilada :only [canvas ctx value-of canvas-size]]
[jayq.core :only [show]]
[monet.core :only [animation-frame]]
@boboldehampsink
boboldehampsink / ios_disable_push_notifications.js
Created March 17, 2015 15:11
Cordova - after_platform_add hook to disable push notifications code
#!/usr/bin/env node
var GCC_PREPROCESSOR_DEFINITIONS = '"$(inherited) DISABLE_PUSH_NOTIFICATIONS=1"';
var fs = require("fs");
var path = require("path");
var xcode = require('xcode');
var projectRoot = process.argv[2];
function getProjectName(protoPath) {
@scttnlsn
scttnlsn / core.cljs
Last active July 2, 2016 07:36
Om/Secretary nested routing
(ns nested-routing.core
(:require-macros [om.core :as om]
[secretary.core :refer [defroute]])
(:require [om.dom :as dom]
[om.core :as om]
[secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType])
(:import goog.History))
@bhauman
bhauman / core.cljs
Last active August 16, 2022 12:08
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.