Skip to content

Instantly share code, notes, and snippets.

View dviramontes's full-sized avatar
〰️
failing forward

David Viramontes dviramontes

〰️
failing forward
View GitHub Profile
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
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

@ljharb
ljharb / array_iteration_thoughts.md
Last active April 22, 2024 10:15
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@mfikes
mfikes / source.md
Last active December 27, 2016 20:04
Source for C and ClojureScript comparison
@ralphschindler
ralphschindler / README.md
Last active September 30, 2023 19:28
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

@ignacy
ignacy / async_no_link.ex
Created March 15, 2016 10:51
Example of using Task.Supervisor.async_nolink with Elixir Tasks
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@bostonou
bostonou / promise.cljs
Created July 14, 2015 01:14
Promise.all with core.async
(ns cljs-made-easy.core
(:refer-clojure :exclude [into])
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cljs.core.async :refer [<! >!] :as a]))
(enable-console-print!)
(defn resolving-promise [key t reject]
(go
(pr (str key " starting"))
@ducky427
ducky427 / core.cljs
Created June 11, 2015 11:31
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"resources"}
:dependencies '[[adzerk/boot-cljs "0.0-2814-4" :scope "test"]
[adzerk/boot-cljs-repl "0.1.9" :scope "test"]
[adzerk/boot-reload "0.2.4" :scope "test"]
[pandeiro/boot-http "0.6.1" :scope "test"]
[cljsjs/jquery "1.9.0-0"]
[quil "2.2.5" :exclusions [[org.clojure/clojurescript]
[com.cemerick/piggieback]]]]) ;;