Skip to content

Instantly share code, notes, and snippets.

@snipe
snipe / gist:5512408
Created May 3, 2013 18:25
ASCII Goatse
* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@reborg
reborg / rich-already-answered-that.md
Last active July 11, 2024 09:54
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

How Clojure's documentation can leapfrog other languages

Summary

I made a documentation generator that cashes in on Clojure's dynamism. See the play-cljs docs (a ClojureScript game library) for an example of its output.

The Problem

Like many of you, I've often wondered what my final regret will be on my deathbed. My best guess came to me in a dream recently. I was walking across the charred earth of an apocalyptic future world, maneuvering around the remains of the less fortunate. I was startled to find a young girl, barely holding onto her life. She murmured something to me. I asked her to repeat it, and she said more loudly: "I...wish your Clojure projects didn't have such crappy documentation."

@chaitanyagupta
chaitanyagupta / mem-usage.lisp
Last active April 13, 2024 07:18
Memory usage in a Lisp image
;;;; mem-usage.lisp
;;; MEM-USAGE returns memory used by Lisp image in a plist.
;;; MEM-USED prints memory allocated while running the given forms.
;;; Works on SBCL, CMUCL, CCL and CLISP.
;;; Relies on internal APIs (the ones that ROOM uses). Can break at any time.
(defpackage #:mem-usage
(:use #:cl)
(:export #:mem-usage #:mem-used))
@cellularmitosis
cellularmitosis / solutions-by-language.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by language

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by language)

Browsing solutions is a great way to quickly familiarize yourself with a new language!

@cellularmitosis
cellularmitosis / solutions-by-exercise.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by problem

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by exercise)

Browsing solutions to the same problem is a great way to compare languages!

@weilbith
weilbith / autoload_utils_layout.vim
Last active March 12, 2019 13:48
Dark Powered Vim - Fix The Broken Window Layout (file names are using '_' to simulate a '/', leveraging Vim's autload functionalities)
" Standard shape values when fail to retrieve a global variable.
let s:standard_width = 30
let s:standard_height = 10
" List of all windows, which should have a fixed size and/or position.
let g:layout_fixed_windows = [
\ {
\ 'buffer_name': 'Scratch',