Skip to content

Instantly share code, notes, and snippets.

@mynomoto
mynomoto / gist:11928f70aa9273f8e9f4
Created Aug 12, 2014
Reactive font size and grid
View gist:11928f70aa9273f8e9f4
(page "index.html")
(defc t "Grumpy wizards make toxic brew for the evil Queen and Jack.")
(defc size 16)
(defn r [size] (range 1 size))
(defc= make-grid
(str "background-size: " size "px, " size "px; background-image:repeating-linear-gradient(0deg, #000, #000 1px, transparent 1px, transparent "
size "px); height:100%; width:100%; position:absolute;z-index: 1"))
@mynomoto
mynomoto / cats.clj
Created Apr 24, 2019
Sample of using funcool/cats {:mvn/version "2.3.2"}
View cats.clj
(ns kondo.cats
(:require
[cats.core :as m]
[cats.monad.either :refer [left left? right right?]]))
(defn assoc-b
[m v]
(right (assoc m :b v)))
(defn merge-2
View Dockerfile
FROM openjdk:8u121-jdk-alpine
RUN apk update && apk add curl bash
ADD https://private/url/for/datomic-pro.zip /datomic-pro.zip
RUN mkdir /datomic && unzip /datomic-pro.zip -d /datomic
ADD go.sh /go.sh
RUN chmod 755 /go.sh
View Datomic-HSQLDB Storage.md

Howto - Setting Up an HSQLDB Storage for Datomic

This gist walks you through the steps of setting up a storage for your datomic starter instance to use an HSQLDB instance (running as a standalone server - i do not address embedded, http, in memory or other forms of the server). I am sure the same can be applied to any other SQL based storage so it should be portable to Apache Derby. I am writing this for those who may find it useful in getting this done quickly without spending a week as I did trying to figure out what I was doing wrong.

Part I : Install & Setup Your Storage: the HSQLDB Server

  1. Download the latest version of the database from here
  2. The most important file you will need is the hsqldb.jar file. This is the database. This will need to be in your classpath to be able to run the server.
  3. I then create a bash script for easy execution of the Network Server version of the database as shown below.
@mynomoto
mynomoto / explorando_marte.md
Created Oct 25, 2017 — forked from nirev/explorando_marte.md
Teste de Programação - Backend - XERPA
View explorando_marte.md

Teste de Programação - Backend - XERPA

Olá! Como parte do processo de seleção da Xerpa, gostaríamos que você fizesse uma pequena tarefa. Esperamos que ela seja feita preferencialmente em uma das nossas linguagens principais: Elixir, Erlang ou Clojure.

A ideia é olhar como é seu estilo de programação e quais decisões você toma ao resolver um problema. Para isso, crie um projeto no seu Github para podermos acompanhar a árvore de commits!

Sinta-se à vontade para criar em cima do problema abaixo.

@mynomoto
mynomoto / missing_keys_specs.clj
Created Oct 16, 2017 — forked from stuarthalloway/missing_keys_specs.clj
I think it would be a mistake to introduce temporal coupling to prevent typos.
View missing_keys_specs.clj
;; I think it would be a mistake to introduce temporal coupling to prevent typos.
;; The example program below lets you identify "missing" keys specs at
;; the time and place of your choosing, and then handle them as you
;; deem appropriate, without imposing those decisions on other
;; users of spec.
(require '[clojure.spec.alpha :as s]
'[clojure.set :as set])
View keybase.md

Keybase proof

I hereby claim:

  • I am mynomoto on github.
  • I am mynomoto (https://keybase.io/mynomoto) on keybase.
  • I have a public key ASAMf1rWQrOzOESVx3LdT_IrgJTyxreNYJyzwZVyIIFPFQo

To claim this, I am signing this object:

View limit
#!/bin/sh
set -e
die () {
echo "$@"
exit 1
}
limit_memory () {
@mynomoto
mynomoto / react_relay.clj
Created Apr 5, 2017 — forked from domkm/react_relay.clj
This is an incredibly hacky ClojureScript wrapper for Relay 0. While we used this in production at one point, I would recommend against doing so. I'm only uploading it for posterity. Relay 1, which decouples the React wrapper from the GraphQL client, will enable us to write a good CLJS wrapper, as opposed to this abomination.
View react_relay.clj
(ns broadbrim.react-relay
(:require
[cljs.core :refer [specify! this-as js-arguments js-obj]]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.macro :as macro]
[me.raynes.conch :as conch]
[potemkin]
[sablono.core :as sablono]
[taoensso.timbre :as log]))