Skip to content

Instantly share code, notes, and snippets.

@drewolbrich
drewolbrich / Entity+MoveAsync.swift
Last active March 6, 2024 15:47
An async version of RealityKit's Entity/move that returns when the animation completes
//
// Entity+MoveAsync.swift
//
// Created by Drew Olbrich on 1/15/24.
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@hagmonk
hagmonk / lein-m1-vs-intel.md
Last active March 19, 2022 08:35
Benchmarking Leiningen on Apple Silicon

Benchmarking Leiningen on Apple Silicon

Gene was tweeting about Clojure's startup performance on Apple Silicon, so I decided to benchmark my new MacBook Air with the M1 chip against my Intel based MacBook Pro.

TL;DR

img

The M1 chip in the MacBook Air - which lacks a fan - was able to quite tidily beat an almost top-of-the-line Intel chip.

@wtaysom
wtaysom / bel-eve-vr.md
Last active January 24, 2024 03:25
A Review of Paul Graham's Bel, Chris Granger's Eve, and a Silly VR Rant

Hello Friends,

This elf begging to climb onto the web for Christmas began as a personal email, a review of Paul Graham's little Lisp Bel. He sprouted arms, legs, and in gingerstyle ran away. Arms for symbols, legs for conses: these primitives are the mark a Lisp — even more so than the parenthesis. What do we get when we remove these foundation stones: naming and pairing?

No pairs. No cons. No structure. Unordered. Chaos. Eve, a beautifully incomplete aspect oriented triple store. No need for legs when you can effortlessly transport to your destination. Lazy. Pure. Here and now, a retrospective.

No symbols. No names. No variables. Combinators. Forth. No need for arms when you can effortlessly push and pop your stack. No words. A world without words. Virtual worlds. Virtual reality. Space. Time. Motion. Action. Kinetic Programming, a proposal.

I apologize in advance. Checking my pocketwatch, I see I haven't t

@philoskim
philoskim / cljs-macro.adoc
Last active May 7, 2018 21:33
How to enumerate the ClojureScript macros

How to enumerate the cljs.core macros in ClojureScript

I wanted to enumerate the macros of cljs.core in ClojureScript. In general, it would not be needed for everyday ClojureScrit programming but I need it to author my debux library.

At first, I asked a question about this problem in Google Clojure Group but got no answers.

I decided to find the way by myself and finally found a way to enumerate the macros of cljs.core in Clojure REPL, so I want to share the exprerience with others here.

The functions of cljs.core are defined in src/main/cljs/cljs/core.cljs and the macros of cljs.core are defined in src/main/clojure/cljs/core.cljc. So you have to evaluate the src/main/clojure/cljs/core.cljc file in Clojure REPL, not in ClojureScript REPL, to get a list of the macros of cljs.core.

@bagder
bagder / trrprefs.md
Last active December 27, 2022 05:17
This once held TRR prefs. Now it has moved.

NOTE

This content has moved.

Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!

@mrry
mrry / tensorflow_self_check.py
Last active August 24, 2023 17:13
[DEPRECATED] TensorFlow on Windows self-check
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@thegeez
thegeez / spec_parsing.clj
Last active December 30, 2023 18:17
Parsing with clojure.spec for the Advent of Code challenge
(ns net.thegeez.advent.spec-parsing
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :as tgen]))
;; Dependencies:
;; [org.clojure/clojure "1.9.0-alpha14"]
;; [org.clojure/test.check "0.9.0"]
;; Advent of Code is a series of code challenges in the form of an advent
@petterik
petterik / gist:50779d8cf15d6b6443e4
Created February 22, 2016 14:47
Trying optimistic updates with om.next, datascript and datomic [Questions]
I'm trying to implement optimistic updates using om.next, datascript and datomic. Mutations should be visible instantly in the UI (the optimistic part) and synced with datomic once the mutation has been successfully transacted. Mutations should also be retryable.
I might be going about this all wrong, but here's the way I'm going about it:
Client:
0. Call om/transact with a mutation `[(my/mutation { ... }) :read/this...]
1. Transact update to datascript and save the optimistic transaction's tx number.
2. Pass the optimistic tx number in the remote's ast's :params (more on this later).
Server:
3. Transact update to datomic returning entities created in datomic and the optimistic tx number from :params, to client.
Client:
@idibidiart
idibidiart / GraphQL-Architecture.md
Last active September 16, 2023 18:36
Building an Agile, Maintainable Architecture with GraphQL

Building a Maintainable, Agile Architecture for Realtime, Transactional Apps

A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.

With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.

We use GraphQL to dyn

@dpritchett
dpritchett / naur.md
Last active January 10, 2023 18:58
Programming as Theory Building

Programming as Theory Building

Peter Naur, 1985

(copied from http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22)

Introduction

The present discussion is a contribution to the understanding of what programming is. It suggests that programming properly should be regarded as an activity by which the programmers form or achieve a certain kind of insight, a theory, of the matters at hand. This suggestion is in contrast to what appears to be a more common notion, that programming should be regarded as a production of a program and certain other texts.