Skip to content

Instantly share code, notes, and snippets.

@AllenDang
AllenDang / gccemacs.md
Last active August 15, 2023 15:45
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.

Some thoughts on building software

Lately I have been busy reading some new books on Domain Driven Design (DDD) and software architecture -- including a short yet eye-opening one in Python and a great one in F#. At the same time, it seems that more people in the Functional Programming world are looking at more formal approaches to modelling -- some examples here. This has brought some thought from the background of my brain about how we should model, organize, and architect software using the lessons we've learnt from functional programming.

Before moving on, let me be clear about this being just a dump of some thoughts, not always well-defined, definite

@davidbalbert
davidbalbert / miniKanren.swift
Last active April 4, 2024 19:47
miniKanren
// miniKanren.swift, written by David Albert, and released into the public domain.
//
// An implementation of the miniKanren relational programming language. Somewhat
// reductively, relational programs can be run both forwards and backwards. In
// addition to asking "what does this function return when passed these arguments,"
// you can also ask "what arguments to this function return the following value?"
// This lets you ask questions like like "what pairs of numbers sum to 12," which
// if you allow for negative numbers has an infinite number of solutions.
//
// Some mind bending miniKanren programs that others have written include: a
@porterjamesj
porterjamesj / three.jl
Last active December 15, 2018 12:48
Advent of Code day 3 (https://adventofcode.com/2018/day/3) solution in Julia (https://julialang.org/)
function count_overclaims(claims)
fabric = zeros(1000, 1000)
for claim in claims
claimed_area = view(
fabric,
claim[:x]+1:claim[:x]+claim[:width],
claim[:y]+1:claim[:y]+claim[:height],
)
claimed_area .+= 1
end
@JEFworks
JEFworks / pointillism.R
Last active July 30, 2018 12:48
Pointillism filter: Convert an image (RGB array) into array of points in a style reminiscent of pointillism
#' Pointillism filter
#'
#' @description Convert an image (RGB array) into array of points in a style reminiscent of pointillism
#'
#' @param img Image array.
#' @param k Point size. Bigger k means bigger point / less detail.
#' @param seed Random seed for voxel color sampling.
#'
#' @examples {
#' ## Read image
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 7, 2024 09:05
Swift Concurrency Manifesto
@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift
@simecek
simecek / rmagic_example.ipynb
Last active January 16, 2021 13:29
How to add R code to your (IPython) Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reborg
reborg / rich-already-answered-that.md
Last active May 5, 2024 04:45
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@physacco
physacco / README.md
Last active December 27, 2023 09:05
Python 3 extension example

Python 3 extension example

Build

python3 setup.py build

Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so

Run