Skip to content

Instantly share code, notes, and snippets.

View caioaao's full-sized avatar
🏠
Working from home

Caio Oliveira caioaao

🏠
Working from home
View GitHub Profile
@drejohnson
drejohnson / Index.re
Last active June 30, 2020 21:03
basic reasonml binding for lit-html. WIP
/* Works but props not added to values array */
let sayHello = name =>
LitHtml.html(
{j|
<h1>Hello $(name) </h1>
<p>Goodbye</p>
<div>
<span>This is nested</span>
</div>
|j},
@guilhermebruzzi
guilhermebruzzi / github-net-config.md
Last active May 22, 2023 17:02
NET não libera a porta 22 e impede de acessar o github por ssh

Usar ssh do github com wifi do netcombo

A NET parece que só libera o uso de qualquer porta, como a porta 22 de ssh, para pessoa jurídica em seus novos planos (desde 2016).

Para conseguir usar o github por ssh com plano de internet da NET para pessoa física, é necessário:

Criar o arquivo ~/.ssh/config e adicionar:

Host github.com
@apeckham
apeckham / .clj
Last active July 28, 2021 20:54
find free port in clojure
(defn get-free-port []
(with-open [socket (ServerSocket. 0)]
(.getLocalPort socket)))
@jcf
jcf / log.clj
Created September 4, 2016 11:22
Refresh logback.xml from a Clojure REPL
(ns app.log
(:require [clojure.java.io :as io])
(:import ch.qos.logback.classic.joran.JoranConfigurator
ch.qos.logback.classic.LoggerContext
org.slf4j.LoggerFactory))
(defn reload-logback
[]
(let [context ^LoggerContext (LoggerFactory/getILoggerFactory)
configurator (JoranConfigurator.)
(def ^:dynamic *indent* 0)
(alter-var-root
#'clojure.core/load
(fn [orig]
(fn [& paths]
(let [t (System/nanoTime)
r (binding [*indent* (inc *indent*)]
(apply orig paths))]
(binding [*out* *err*]
(println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime) t) 1000000.0) paths)