Skip to content

Instantly share code, notes, and snippets.

View avichalp's full-sized avatar
🎯
Focusing

Avichal avichalp

🎯
Focusing
View GitHub Profile
@andrewxhill
andrewxhill / Chain Of Trust (but verify).ipynb
Last active November 8, 2023 06:14
Chain of Trust - but verify...
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rorycl
rorycl / ed25519genandsave.go
Created June 5, 2021 16:14
Generate ed25519 keys in PEM format using Go
// RCL 05 June 2021
/*
verify with `openssl pkey -in <privatekey>` or `openssl pkey -in <privatekey> -pubout`
the latter should match the publickey
*/
package main
import (
@cgrand
cgrand / gist:564d6e8ad57299f64beb438e4a8b709f
Created July 11, 2020 20:26 — forked from KingCode/gist:773560f4ab5bf91e660a2a26e581b036
cond-let and cond-let| macros, to leverage bindings between test and result expressions, as well as earlier ones (for cond-let)
;; (cond-let
;; (odd? x) [x n] (inc x)
;; (< n 10) [y (inc n)] 10
;; :else n))
;; we want the above to yield
;; (let [x n]
;; (if (odd? x)
;; (inc x)

React Native + macOS + Clojurescript

image

Project Catalyst

Since the recent release of Catalina, macOS has shipped with the ability to allow iOS/iPAD apps to run on macOS without any modification via a featureset known as Project Catalyst.

This is exciting, as writing React Native + Clojurescript apps as a target for the desktop is much more compelling than a pure Electron app (imo).

(require '[clojure.set :as set])
(def info
[{:year 2017
:month 4
:data "x"}
{:year 2017
:month 4
:data "y"}

clojure.spec

Available in Clojure 1.9 (now in alpha)

(defproject robochef "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.9.0-alpha5"]])

In the namespace clojure.spec

@ghoseb
ghoseb / clj_spec_playground.clj
Last active March 30, 2019 22:35
Examples of Clojure's new clojure.spec library
(ns clj-spec-playground
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.test.check.generators :as gen]))
;;; examples of clojure.spec being used like a gradual/dependently typed system.
(defn make-user
"Create a map of inputs after splitting name."
([name email]
@jibs
jibs / gcloud-port-forward.md
Created April 25, 2015 15:57
port forwarding with a google cloud instance

Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:

gcloud compute  ssh --ssh-flag="-L 8088:localhost:8088"  --zone "us-central1-b" "example_instance_name"

Now browsing to localhost:8088 works as it would with standard ssh.

@mcasperson
mcasperson / gist:11315910
Last active December 3, 2020 07:49
Pandoc Emscripten
Add this to Ghc-Options in pandoc.cabal
-fllvm -keep-llvm-files -fforce-recomp
./emcc <all *.ll files> -o pandoc.js
emcc ./src/Text/Pandoc.ll ./src/Text/Pandoc/Compat/TagSoupEntity.ll ./src/Text/Pandoc/Compat/Monoid.ll ./src/Text/Pandoc/XML.ll ./src/Text/Pandoc/Writers/ICML.ll ./src/Text/Pandoc/Writers/FB2.ll ./src/Text/Pandoc/Writers/Man.ll ./src/Text/Pandoc/Writers/EPUB.ll ./src/Text/Pandoc/Writers/RST.ll ./src/Text/Pandoc/Writers/Docbook.ll ./src/Text/Pandoc/Writers/Org.ll ./src/Text/Pandoc/Writers/Markdown.ll ./src/Text/Pandoc/Writers/HTML.ll ./src/Text/Pandoc/Writers/ConTeXt.ll ./src/Text/Pandoc/Writers/Docx.ll ./src/Text/Pandoc/Writers/Texinfo.ll ./src/Text/Pandoc/Writers/MediaWiki.ll ./src/Text/Pandoc/Writers/Native.ll ./src/Text/Pandoc/Writers/Shared.ll ./src/Text/Pandoc/Writers/OpenDocument.ll ./src/Text/Pandoc/Writers/ODT.ll ./src/Text/Pandoc/Writers/Custom.ll ./src/Text/Pandoc/Writers/OPML.ll ./src/Text/Pandoc/Writers/RTF.ll ./src/Text/Pandoc/Writers/AsciiDoc.ll ./src/Text/Pandoc/Writers/LaTeX.l