Beautiful code is just beautiful. Doesn't need to be simple.
- Ugly factorial function
fn factorial_loop(n: u32) -> u32 {
let mut result = 1;
for i in 1..=n {
result *= i;
}
result
Beautiful code is just beautiful. Doesn't need to be simple.
fn factorial_loop(n: u32) -> u32 {
let mut result = 1;
for i in 1..=n {
result *= i;
}
result
function pipe<A>(value: A): A; | |
function pipe<A, B>(value: A, fn1: (input: A) => B): B; | |
function pipe<A, B, C>(value: A, fn1: (input: A) => B, fn2: (input: B) => C): C; | |
function pipe<A, B, C, D>( | |
value: A, | |
fn1: (input: A) => B, | |
fn2: (input: B) => C, | |
fn3: (input: C) => D | |
): D; | |
function pipe<A, B, C, D, E>( |
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data. This means that in functional programming, functions are first-class citizens, which means that they can be treated like any other value in the language and can be passed as arguments to other functions or returned as the result of a function.
In short functional programming:
unbind C-b | |
set -g prefix ` | |
unbind r | |
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf" | |
set -g mouse on | |
set-option -sg escape-time 10 | |
set-option -g focus-events on |
env: | |
TERM: xterm-256color | |
font: | |
size: 14 | |
normal: | |
family: "Dank Mono" | |
style: Regular | |
bold: | |
style: Bold |
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": [ | |
{ | |
"command": { | |
"action": "copy", | |
"singleLine": false | |
}, | |
"keys": "ctrl+c" |
tailwind isn't easier/harder than bootstrap. its a completely different thing. tailwind has pre-defined classes for all css properties.
flex
is a class that has this css:
.flex {
display: flex;
}
text-black
is class that just changes the colour and nothing else:
# Install-Module PSReadLine | |
Clear-Host [] | |
Invoke-Expression (&starship init powershell) | |
Write-Host "Welcome Back Shoubhit!" | |
Import-Module PSReadLine | |
# Shows navigable menu of all options when hitting Tab | |
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete |
[aws] | |
symbol = " " | |
[conda] | |
symbol = " " | |
[dart] | |
symbol = " " | |
format = "via [$symbol]($style)" |