There are various test suites under src/test
- cljs
- cljs_cli
- clojure
- self
| // 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 |
| 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); |
Acknowledge that you might actually want to use Propel instead of relying on this Gist.
Clone this Gist:
git clone https://gist.github.com/eerohele/e06551b115c6a31d1280a115c4c2abb2 preplOpen the project in your favorite editor/IDE.
Start evaluating the forms in prepl.clj one by one.
| (defn project-paths [projection] | |
| (loop [pr projection | |
| paths '[]] | |
| (let [[el next] pr] | |
| (if (empty? pr) | |
| paths | |
| (if (vector? next) | |
| (recur | |
| (drop 2 pr) |
| 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; |
| (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. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ;; | |
| ;; 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. |