Skip to content

Instantly share code, notes, and snippets.

View nexxeln's full-sized avatar
🔍
duck duck going stuff

Shoubhit Dash nexxeln

🔍
duck duck going stuff
View GitHub Profile

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
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>(
@nexxeln
nexxeln / modern-fp.md
Created December 17, 2022 09:08
Scrapped blog post

What is Functional Programming?


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:

@nexxeln
nexxeln / Microsoft.PowerShell_profile.ps1
Created March 15, 2022 09:53
my powershell profile
# 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
@nexxeln
nexxeln / starship.toml
Created March 15, 2022 09:48
my starship config
[aws]
symbol = " "
[conda]
symbol = " "
[dart]
symbol = " "
format = "via [$symbol]($style)"