Skip to content

Instantly share code, notes, and snippets.

View rarous's full-sized avatar
💭
I may be slow to respond.

Aleš Roubíček rarous

💭
I may be slow to respond.
View GitHub Profile
@dukejones
dukejones / cloudflare-worker-rollbar.ts
Created March 13, 2020 05:56
Log errors and messages to Rollbar from a Cloudflare Worker
import ErrorStackParser from 'error-stack-parser'
const ROLLBAR_ACCESS_TOKEN = '[ACCESS TOKEN]'
var rollbarUrl = `https://api.rollbar.com/api/1/item/`
// https://github.com/rollbar/rollbar.js/blob/master/src/errorParser.js
function Frame(stackFrame: ErrorStackParser.StackFrame) {
var data:any = {};
// data._stackFrame = stackFrame;
@mfikes
mfikes / cljs.md
Last active January 6, 2024 07:13
cljs command

If you wan't a cljs that acts like clj, but for ClojureScript, there are a few minor changes you can make:

First, add the following entry to ~/.clojure/deps.edn under the :deps key:

org.clojure/clojurescript {:mvn/version "1.10.439"}

Then make copies of clj and clojure named cljs and clojurescript, and put those copies on your path.

@fnky
fnky / ANSI.md
Last active July 3, 2024 11:00
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@mtnygard
mtnygard / README.md
Last active May 9, 2018 04:38
Create a dependency matrix of Clojure namespaces.

The dependency matrix shows the strength of coupling at a var-by-var level between namespaces.

If you pull the CSV output into a spreadsheet, the numbers in the cells show how many var->var dependencies there are between the namespaces.

If you want to just look at namespace->namespace dependencies (e.g., to create a visualization) then just consider any cell > 0 as a dependency.

@lenkavon
lenkavon / reactiveconf-2017-cfp-shared-logic-web-mobile.md
Last active November 21, 2017 10:00
Sharing code between web and mobile using React, ReactNative and Redux

This is the response to lightning talk CFP at ReactiveConf.

Sharing code between web and mobile using React + ReactNative + Redux

When you stand in front of the project that aims to come with mobile and web application, going for combo React.js & ReactNative is easy choice. But to decide how to handle the data flow is a different story.

My team made this decision and after couple of talks and earlier experience with graphQL + Relay, we went for Redux. Redux enabled us to share most of the bussines logic even though the apps differ in usecases. I would like to share the challenges we had to overcome with you.

Checkout ClojureScript master and cd to the top of the checkout tree.

Assuming you know it is broken on master but worked in 1.9.562, and there is an easy test you can do right in the REPL.

Run these three commands in your shell:

git bisect start
git bisect bad HEAD
git bisect good r1.9.562
@cdelaitre
cdelaitre / docker-compose-tick.yml
Last active March 22, 2021 20:01
Monitor Docker Swarm with the InfluxData TICK Stack
version: '3'
services:
# FRONT
chronograf:
# Full tag list: https://hub.docker.com/r/library/chronograf/tags/
image: chronograf
deploy:
replicas: 1
placement:
constraints:
@cgrand
cgrand / xlife.clj
Created August 16, 2016 14:48
transduced game of life
(ns xlife
(:require [net.cgrand.xforms :as x]))
;; xforms is a library of transducers
(defn xstep [cells]
(into #{}
(comp
; a comprenhension to generate neighbours
(x/for [[x y] %
@frank-leap
frank-leap / digitalocean-swarm.sh
Last active March 16, 2023 13:22
Script to create a Docker Swarm cluster in Digital Ocean
#!/bin/bash
# Configuration
#export DIGITALOCEAN_ACCESS_TOKEN= # Digital Ocean Token (mandatory to provide)
export DIGITALOCEAN_SIZE=512mb # default
export DIGITALOCEAN_REGION=nyc3 # default
export DIGITALOCEAN_PRIVATE_NETWORKING=true # default=false
#export DIGITALOCEAN_IMAGE="ubuntu-15-04-x64" # default
# For other settings see defaults in https://docs.docker.com/machine/drivers/digital-ocean/