Skip to content

Instantly share code, notes, and snippets.

View AaronDovTurkel's full-sized avatar
🦄

adt AaronDovTurkel

🦄
View GitHub Profile
@danielsz
danielsz / polling.clj
Last active October 7, 2024 05:05
Polling endpoint with core.async
(ns clojure.polling
(:require [clj-http.client :as client]
[clojure.core.async :as async :refer [>!! timeout <! go-loop]]
[cheshire.core :as json]
[clojure.tools.logging :as log]))
(defn client
([endpoint]
(client/get endpoint))
([endpoint c e]
@rts-rob
rts-rob / docker-compose.yml
Last active August 17, 2022 02:34
Local development of Cloudflare Workers and Fauna with Fauna Dev and Miniflare
# Copyright Fauna, Inc.
# SPDX-License-Identifier: MIT-0
version: "3.9"
services:
fauna:
image: fauna/faunadb:latest
ports:
- "8443:8443"
- "8444:8444"
@gahabeen
gahabeen / HasRoleUDF.js
Last active January 21, 2022 16:36
Managing Roles Memberships in Fauna (DB)
// HasRole - User-Defined Function
CreateFunction({
name: 'HasRole',
body: Query(Lambda(['role', 'ref'], Select(Var('role'), Call('RolesMemberships', [Var('ref')]), false)))
})
@yogthos
yogthos / clojure-beginner.md
Last active April 18, 2025 02:43
Clojure beginner resources

Introductory resources

@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active April 24, 2025 04:57 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@jmosul
jmosul / SimpleVueServiceProvider.js
Last active September 26, 2023 01:04
A simple (singleton) service provider for VueJS
class ServiceProvider {
constructor(services) {
this._services = services;
// use proxy to create a "magic getter" that will search the _services for a matching name
// then call "_makeOnce" to instantiate or return the singleton
return new Proxy(this, {
get: (provider, service) => {
service = service.charAt(0).toUpperCase() + service.slice(1);
@guilherme
guilherme / gist:9604324
Last active October 10, 2024 18:27
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then