Skip to content

Instantly share code, notes, and snippets.

View athomasoriginal's full-sized avatar
💭
Clojure, ClojureScript, JavaScript and one day...Jai

Thomas Mattacchione athomasoriginal

💭
Clojure, ClojureScript, JavaScript and one day...Jai
View GitHub Profile

2020-09-12 Testing ClojureScript itself

General

There are various test suites under src/test

  • cljs
  • cljs_cli
  • clojure
  • self
@judah-caruso
judah-caruso / theme-definitions.4coder
Last active February 3, 2023 03:15
A file containing 4coder theme definitions and their descriptions
// This file contains each 4coder theme definition and what it does within the editor.
// Main editor
defcolor_back = 0xFF000000; // Main buffer background
defcolor_text_default = 0xFFFFFFFF; // Default character foreground
defcolor_at_cursor = 0xFF000000; // Cursor foreground
defcolor_cursor = {0xFF000000, 0xFF000000}; // [0] Cursor background, [1] Active macro recording cursor background
defcolor_mark = 0xFF000000; // Mark background
defcolor_highlight_cursor_line = 0xFF000000; // Current line background
defcolor_margin_active = 0xFF000000; // Active buffer outline
@thevaber
thevaber / hex_colors.cpp
Created January 19, 2020 20:16
4coder theme file color preview
function void
tv_colorize_hex_colors(Application_Links *app, Buffer_ID buffer, Text_Layout_ID text_layout_id)
{
Scratch_Block scratch(app);
Range_i64 visible_range = text_layout_get_visible_range(app, text_layout_id);
String_Const_u8 text = push_buffer_range(app, scratch, buffer, visible_range);
for (i64 index = visible_range.min; text.size > 0;) {
if (text.size >= 2+8 && text.str[0] == '0' && (text.str[1] == 'x' || text.str[1] == 'X')) {
text = string_skip(text, 2);
@eerohele
eerohele / README.md
Last active November 6, 2021 19:10
A minimal, annotated example of using Clojure prepl with core.async
  1. Acknowledge that you might actually want to use Propel instead of relying on this Gist.

  2. Clone this Gist:

    git clone https://gist.github.com/eerohele/e06551b115c6a31d1280a115c4c2abb2 prepl
  3. Open the project in your favorite editor/IDE.

  4. Start evaluating the forms in prepl.clj one by one.

@lilactown
lilactown / projection.clj
Created August 11, 2018 04:30
Project a map onto a tree of keys
(defn project-paths [projection]
(loop [pr projection
paths '[]]
(let [[el next] pr]
(if (empty? pr)
paths
(if (vector? next)
(recur
(drop 2 pr)
@pesterhazy
pesterhazy / minimalist-migration-framerwork.sql
Created October 19, 2017 14:59
Minimalist migration framework for PostgreSQL
create table if not exists migrations (
key text CONSTRAINT pkey PRIMARY KEY
);
create or replace function idempotent(migration_name text,code text) returns void as $$
begin
if exists (select key from migrations where key=migration_name) then
raise notice 'Migration already applied: %', migration_name;
else
raise notice 'Running migration: %', migration_name;
@pesterhazy
pesterhazy / promises-passing-values.cljs
Last active October 24, 2021 00:55
Promise chains in ClojureScript and the problem of previous values
(ns my.promises
"Demo to show different approaches to handling promise chains in ClojureScript
In particular, this file investigates how to pass data between Promise
callbacks in a chain.
See Axel Rauschmayer's post
http://2ality.com/2017/08/promise-callback-data-flow.html for a problem
statement.
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.