Skip to content

Instantly share code, notes, and snippets.

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

Juan A. Ruz tangrammer

🏠
Working from home
View GitHub Profile
@opqdonut
opqdonut / deps.edn
Created June 1, 2022 11:31
Clojure structured logging via Log4J2
{:deps {org.apache.logging.log4j/log4j-api {:mvn/version "2.17.2"}
org.apache.logging.log4j/log4j-core {:mvn/version "2.17.2"}
org.apache.logging.log4j/log4j-layout-template-json {:mvn/version "2.17.2"}
org.apache.logging.log4j/log4j-slf4j18-impl {:mvn/version "2.17.2"}}}
@jackrusher
jackrusher / deploy.sh
Created January 17, 2022 15:22
Writing and deploying Google Cloud Functions in Clojure using NBB
# command line to deploy the project
gcloud functions deploy hello --runtime nodejs14 --trigger-http
@borkdude
borkdude / 1) bb.edn
Last active January 25, 2023 23:52
Work bb.edn files
{:tasks {:requires ([babashka.fs :as fs])
:init (do (when (seq (fs/modified-since "deps.edn"
["deps.template.edn"
"../base/deps.edn"]))
(shell {:dir ".."} "script/gen-deps.clj")))
;; Maintenance tasks
install {:doc "Install frontend dependencies from NPM"
:task (shell "npm install")}
clean {:doc "Clean all artifacts"
@ryu1kn
ryu1kn / core.clj
Last active March 13, 2023 18:59
Use clojure to fetch Dialogflow log from Stackdriver
; src/clojure__gcp/core.clj
(ns clojure--gcp.core
(:import (com.google.cloud.logging LoggingOptions Logging$EntryListOption Logging)))
; Advanced logs queries: https://cloud.google.com/logging/docs/view/advanced-queries
(defn make-filter [project-id]
(str "logName = \"projects/" project-id "/logs/dialogflow_agent\"
labels.type = \"dialogflow_response\"
timestamp >= \"2020-04-05T00:00:00+11:00\""))
@abrochard
abrochard / presentation.org
Last active November 13, 2024 19:00
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
@jackrusher
jackrusher / gcloud-tramp.el
Created June 19, 2019 13:58
Tramping into GCloud instances from within emacs
;; make sure you've set your default project with:
;; gcloud config set project <project-name>
(require 'tramp)
(add-to-list 'tramp-methods
'("gcssh"
(tramp-login-program "gcloud compute ssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@thegeez
thegeez / spec_parsing.clj
Last active December 30, 2023 18:17
Parsing with clojure.spec for the Advent of Code challenge
(ns net.thegeez.advent.spec-parsing
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :as tgen]))
;; Dependencies:
;; [org.clojure/clojure "1.9.0-alpha14"]
;; [org.clojure/test.check "0.9.0"]
;; Advent of Code is a series of code challenges in the form of an advent
@kinathru
kinathru / SURFDetector.java
Created August 6, 2016 13:14
OpenCV Java implementation of SURF example
package com.dummys.learning;
import org.opencv.calib3d.Calib3d;
import org.opencv.core.*;
import org.opencv.features2d.*;
import org.opencv.highgui.Highgui;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
(ns utils.cond
"A collection of variations on Clojure's core macros. Let's see which features
end up being useful."
{:author "Christophe Grand"}
(:refer-clojure :exclude [cond when-let if-let]))
(defmacro if-let
"A variation on if-let where all the exprs in the bindings vector must be true.
Also supports :let."
([bindings then]
@jackrusher
jackrusher / core.cljs
Last active June 4, 2021 19:59
The simplest possible @thing_clj physics + @Quilist demo
(ns gumball-machine.core
(:require [thi.ng.color.core :as col]
[thi.ng.math.core :as m]
[thi.ng.geom.core :as g]
[thi.ng.geom.core.vector :refer [vec3]]
[thi.ng.geom.physics.core :as ph]
[thi.ng.geom.sphere :refer [sphere]]
[quil.core :as q :include-macros true]))
(def particles