- Easy to get started for mainstream programmers (JavaScript, Java, Python, Ruby), don't need to know monads to print a string, no enforcement of pure/impure in the type system, no Lisp-syntax (use Clojure if you want that), strict evaluation
- Readable programs: one true way to layout code, significant whitespace,
minimal noise in code, no custom operators like
.&&.
- Rich set of base data types: int, float, decimal, unicode strings,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -Uz compinit | |
compinit | |
alias ls="ls -F --color" | |
alias vi="/usr/local/bin/nvim" | |
PS1=" | |
▶ %F{81}%U%~%u%f %F{8}$%f " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_std] | |
#![no_main] | |
use panic_probe as _; | |
mod microgroove { | |
mod sequencer { | |
use heapless::Vec; | |
use midi_types::{Channel, Note, Value14, Value7}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#define DISPLAY_WIDTH_PX 128 | |
#define DISPLAY_HEIGHT_PX 64 | |
#define DISPLAY_ADDRESS 0x3D | |
Adafruit_SSD1306 display(DISPLAY_WIDTH_PX, DISPLAY_HEIGHT_PX, &Wire); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <RotaryEncoder.h> | |
#define PIN_IN1 2 | |
#define PIN_IN2 3 | |
RotaryEncoder encoder(PIN_IN1, PIN_IN2); | |
int lastPos = 0; | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
printf("Hello World!\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.section __TEXT,__text,regular,pure_instructions | |
.macosx_version_min 10, 12 | |
.globl _main | |
.p2align 4, 0x90 | |
_main: ## @main | |
.cfi_startproc | |
## BB#0: | |
pushq %rbp | |
Ltmp0: | |
.cfi_def_cfa_offset 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Documents are objects to which a set of edits can be performed. | |
-- | |
-- A simple example is a text document which is subjected to a number of find | |
-- and replace operations. | |
-- | |
-- This module implements a simple state monad which allows operations to be | |
-- written using do notation. Example | |
-- | |
-- badfiction = "11pm. Night time in the city." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pairpeers.core | |
(:require [clojure.data.csv :as csv])) | |
(defn pair-with-first [[s & more]] | |
(map list (repeat s) more)) | |
(defn rows->peers [rows] | |
(->> rows | |
(map pair-with-first) | |
(reduce concat))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def separate_zeroes(nums): | |
''' | |
Given an array of numbers (1,2,3,8,0,2,2,0,10), move all 0s to the right end and all other numbers to the left while keeping relative order of non-zero numbers. Has to be linear in time and in-place. | |
>>> separate_zeroes([1, 2, 3, 8, 0, 2, 2, 0, 10]) | |
[1, 2, 3, 8, 2, 2, 10, 0, 0] | |
>>> separate_zeroes([1, 1, 1, 0, 1, 0, 0, 1]) | |
[1, 1, 1, 1, 1, 0, 0, 0] |
NewerOlder