Skip to content

Instantly share code, notes, and snippets.

🦄

Enzzo souenzzo

🦄
Block or report user

Report or block souenzzo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e67571042d10f94a2b70840566ad9e13
(ns nondeps.core)
(defn -main
[target]
(let [f @#'clojure.core/load
paths (atom [])]
(with-redefs [clojure.core/load (fn [& path]
(swap! paths concat path)
(apply f path))]
View windows95.css
button {
background-color: #c3c7cb;
border: none;
padding: 7px 20px 5px;
box-shadow: inset 1px 1px 0 1px #ffffff, inset 0 0 0 1px #868a8e, 1px 1px 0 0 #000;
}
@souenzzo
souenzzo / deps.edn
Last active Mar 27, 2019
Clojure version of "java quickstart" from gsheets. https://developers.google.com/sheets/api/quickstart/java
View deps.edn
;; run with
;; clj -Sdeps '{:deps {gdocs {:git/url "https://gist.github.com/souenzzo/df540002607b15378f8014237e499fdd" :sha "fee00617c75fc24c74931aa4200f74666c5b66b6"}}}' -m gdocs
{:paths ["."]
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.google.api-client/google-api-client {:mvn/version "1.28.0"}
com.google.oauth-client/google-oauth-client-jetty {:mvn/version "1.28.0"}
com.google.apis/google-api-services-sheets {:mvn/version "v4-rev566-1.25.0"}}}
@souenzzo
souenzzo / Main.java
Created Mar 9, 2019
Run with java --source 11 Main.java
View Main.java
import java.util.Objects;
public class Main {
public static void main(String[] args) {
var foo = new Object() {
String x = "aa";
};
Thread t;
t = new Thread(() -> {
if (Objects.nonNull(foo.x)) {
@souenzzo
souenzzo / deps.edn
Last active Feb 21, 2019
lacinia HTTP API with generators
View deps.edn
{:paths ["."]
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.walmartlabs/lacinia {:mvn/version "0.32.0"}
io.pedestal/pedestal.service {:mvn/version "0.5.5"}
io.pedestal/pedestal.jetty {:mvn/version "0.5.5"}
com.walmartlabs/lacinia-pedestal {:mvn/version "0.11.0"}
org.clojure/test.check {:mvn/version "0.10.0-alpha3"}
com.rpl/specter {:mvn/version "1.1.2"}}}
@souenzzo
souenzzo / deps.edn
Last active Jan 9, 2019
core.async cljs bug. Run 'clj -m cljs.main --repl-env node -m hack'
View deps.edn
;; clj -Srepro -Sdeps '{:deps {cljs-bug {:git/url "https://gist.github.com/souenzzo/2d3e171bf718e32becf3cb9d15ea6dfa" :sha "eded47447764e7eb8d4cb25be1d77640e9c50aaf"}}}' -m hack ## works!
;; clj -Srepro -Sdeps '{:deps {cljs-bug {:git/url "https://gist.github.com/souenzzo/2d3e171bf718e32becf3cb9d15ea6dfa" :sha "eded47447764e7eb8d4cb25be1d77640e9c50aaf"}}}' -m cljs.main --repl-env node -m hack ## Can't recur here at line 44 hack.cljc
{:paths ["."]
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.10.439"}
org.clojure/core.async {:mvn/version "0.4.490"}}}
View average.rs
use std::ops::Add;
use std::ops::Div;
trait IAverage<T> {
fn new(a: T) -> Self;
fn combine(self, b: Self) -> Self;
fn result(self) -> T;
}
// trait Number: Sized
@souenzzo
souenzzo / README.md
Last active Nov 20, 2018
Clara issue demo
View README.md

Run with

clj -Sdeps '{:deps {clara-demo {:git/url "https://gist.github.com/souenzzo/e38e600d486532308084c2bba0a9b3e9" :sha "e08684d9b24e9ea91a9922b2f512bcf0a3eb7a7e"}}}' -m clara-demo

Will print:

[:rule1 :mk-session]
[:rule2 :fire-rules]
["rule1" :a]
["rule2" :a]
View drop-between.clj
(defn drop-between [start? pred? stop?]
(fn [rf]
(let [drop? (volatile! false)]
(fn
([] (rf))
([result] (rf result))
([result input]
(when (stop? input)
(vreset! drop? false))
(when (start? input)
@souenzzo
souenzzo / arch-volatil.sh
Created Oct 2, 2018
cria uma VM com arch linux descartavel em menos de 1 min. Requer ~3Gb de RAM livre (para criar disco+RAM)
View arch-volatil.sh
#!/usr/bin/env sh
set -x
set -e
MNTDIR="/tmp/lol/mnt"
TEMPDISK="/tmp/lol/tempdisk.img"
SSH_PUB="${HOME}/.ssh/id_rsa_$(hostname).pub"
TEMPDIR="$(dirname "${TEMPDISK}")"
You can’t perform that action at this time.