Skip to content

Instantly share code, notes, and snippets.

@idelem
idelem / titleUrlMarkdownClip.js
Last active March 12, 2024 02:01 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@leonoel
leonoel / pump.clj
Last active July 6, 2023 17:13
functional reactive petroleum
;; missionary solution to petrol pump example by Stephen Blackheath and Anthony Jones, ISBN 978-1633430105
;; huanhulan's demo : [live](https://huanhulan.github.io/petrol_pump), [code](https://github.com/huanhulan/petrol_pump)
(ns pump
(:refer-clojure :exclude [first])
(:require [missionary.core :as m])
(:import missionary.Cancelled))
(defn rising
"A transducer that outputs `nil` when the input switches from logical false to logical true."
@vindarel
vindarel / Common Lisp VS Racket - testimonies.md
Last active May 27, 2024 15:02
Common Lisp VS Racket. Feedback from (common) lispers.

Developer experience, libraries, performance… (2021/11)

I'll preface this with three things. 1. I prefer schemes over Common Lisps, and I prefer Racket of the Schemes. 2. There is more to it than the points I raise here. 3. I assume you have no previous experience with Lisp, and don't have a preference for Schemes over Common Lisp. With all that out of the way... I would say Common Lisp/SBCL. Let me explain

  1. SBCL Is by far the most common of the CL implementations in 2021. It will be the easiest to find help for, easiest to find videos about, and many major open source CL projects are written using SBCL
  2. Download a binary directly from the website http://www.sbcl.org/platform-table.html (even for M1 macs) to get up and running (easy to get started)
  3. Great video for setting up Emacs + Slime + Quick Lisp https://www.youtube.com/watch?v=VnWVu8VVDbI

Now as to why Common Lisp over Scheme

@jaidetree
jaidetree / clojure-syntax.clj
Last active April 24, 2020 01:52
This covers most if not all of Clojure's syntax.
;; Comments
(comment (any-valid clojure-form :is fine?)) ; end of line comments
#_i-am-commented-out "but I am not"
;; Values
5 3 1/3 0.5 "hello" :keyword
;; Lists
[1 2 3] ;; Vector - Good for finite, short lists
'(1 2 3) ;; seq - Good for infinite, long lists
;; use spec to define stateful protocols inspired by UBF(b)
;; https://ubf.github.io/ubf/ubf-user-guide.en.html
(require '[clojure.spec.alpha :as s]
'[clojure.core.async :as async])
(defn ubfish
"Takes a protocol definition and four channels. Checks for protocol
violations while copying from-server to-client and from-client
to-server."
@didibus
didibus / user.clj
Created January 29, 2020 04:20
A Clojure user.clj file which lets you lazy load certain namespace at the REPL
(def safe-requires
"List of namespaces to require and refer when inside user ns at load time.
Can be given an initialization body to execute after having been required.
To do so, wrap the lib spec in a vector, and all elements after the lib
spec vector will be evaled after the lib spec has been required."
'[[clojure.repl :as repl :refer (source apropos dir pst doc find-doc)]
[clojure.java.javadoc :as javadoc :refer (javadoc)]
[clojure.pprint :as pprint :refer (pp pprint)]
[clojure.stacktrace :as stacktrace :refer (e)]
@wtaysom
wtaysom / bel-eve-vr.md
Last active January 24, 2024 03:25
A Review of Paul Graham's Bel, Chris Granger's Eve, and a Silly VR Rant

Hello Friends,

This elf begging to climb onto the web for Christmas began as a personal email, a review of Paul Graham's little Lisp Bel. He sprouted arms, legs, and in gingerstyle ran away. Arms for symbols, legs for conses: these primitives are the mark a Lisp — even more so than the parenthesis. What do we get when we remove these foundation stones: naming and pairing?

No pairs. No cons. No structure. Unordered. Chaos. Eve, a beautifully incomplete aspect oriented triple store. No need for legs when you can effortlessly transport to your destination. Lazy. Pure. Here and now, a retrospective.

No symbols. No names. No variables. Combinators. Forth. No need for arms when you can effortlessly push and pop your stack. No words. A world without words. Virtual worlds. Virtual reality. Space. Time. Motion. Action. Kinetic Programming, a proposal.

I apologize in advance. Checking my pocketwatch, I see I haven't t

@ertugrulcetin
ertugrulcetin / clojure-clojurescript-shadow-cljs-aws-elasticbeanstalk-circleci.md
Last active February 22, 2024 04:54
Clojure, ClojureScript and Shadow-cljs - Deploying to Elastic Beanstalk using CircleCi 2
@jdf-id-au
jdf-id-au / transit-connection.cljc
Last active September 10, 2023 09:32
Sketch for connecting henryw374/time-literals to transit
(ns transit-connection
"Connect time-literals to transit."
(:require [time-literals.read-write]
#?(:cljs [java.time :refer [Period
LocalDate
LocalDateTime
ZonedDateTime
OffsetTime
Instant
OffsetDateTime
@jclosure
jclosure / echo_server.el.md
Last active June 30, 2023 16:12
Create a simple tcp server to accept input on a socket in elisp

Accept input such as s-expressions, forms, text for buffer input, commands, etc..

;;; echo-server.el --- -*- lexical-binding: t -*-
;;
;; Copyright (C) 2016-2017 York Zhao <gtdplatform@gmail.com>

;; Author: York Zhao <gtdplatform@gmail.com>
;; Created: June 1, 2016
;; Version: 0.1