Skip to content

Instantly share code, notes, and snippets.

View frectonz's full-sized avatar

Fraol Lemecha frectonz

View GitHub Profile
@nate-sys
nate-sys / Cargo.toml
Last active February 11, 2024 17:18
Using Axum, HTMX, and DisplayDoc
[package]
name = "billion-dollar-idea"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = { version = "0.7.4", features = ["macros", "form"] }
displaydoc = "0.2.4"
serde = { version = "1.0.196", features = ["derive"] }
tokio = { version = "1.36.0", features = ["full"] }
@cgsdev0
cgsdev0 / house_builder.sh
Created February 3, 2024 16:07
house builder pattern in bash
#!/usr/bin/env bash
function house_builder() {
# floors,rooms,has_garage
echo "0,0,0"
}
function set_field() {
local f r g
IFS=, read f r g
@charbelrami
charbelrami / elm-grammar.ebnf
Created January 26, 2024 13:41
Elm EBNF grammar
program = [ comment ], [ "port" ], "module", module_name, "exposing", "(", exposed_list, ")", { import_statement }, { declaration }, { comment };
module_name = identifier, { ".", identifier }, [ comment ];
exposed_list = identifier | "(", identifier, { ",", identifier }, ")", [ comment ] | "..";
import_statement = "import", module_name, [ import_alias ], [ "exposing", "(", exposed_list, ")" ], [ comment ];
import_alias = "as", identifier, [ comment ];
declaration = type_declaration
| type_alias_declaration
@omer-biz
omer-biz / Main.elm
Last active January 9, 2024 18:43
I implemented this after wathing this talk (https://www.youtube.com/watch?v=IcgmSRJHu_8), It's about making an impossible states impossible. Don't forget to do `elm install elm/time`
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, input, text)
import Html.Attributes exposing (value)
import Html.Events exposing (onClick, onInput)
import Time
type alias Question =

Mara's statement on the retraction of ThePhd's RustConf keynote

I was one of the people who didn't vote for ThePhd's keynote; originally because I simply preferred another promising candidate. Later, after hearing technical concerns from an expert that I mostly agreed with, also because of the topic, although I must admit I am no expert on the topic.

The candidate I voted for originally got a few approving comments at first, but ended up being mostly ignored later, mostly because of our lack of process and proper voting.

When it was brought up in the leadership chat that 'there are concerns', I focused on the talk itself rather than focusing on the process failure. That was a mistake, for which I apologize. I am not an expert on this topic, and should not have rushed myself into talking about things outside my expertise, even under pressure.

In another situation this could have been a minor mistake with no consequences, just one of several opinions in a discussion, but in this situation it became part

@frectonz
frectonz / scramble.ts
Last active March 6, 2023 14:23
From cassido's March 6, 2023 Newsletter
function scramble(sentences: string[]): string {
return sentences
.map((sentence) =>
sentence
.split(" ")
.map((word) => {
if (word.length <= 3) {
return word;
}
@frectonz
frectonz / repeated_groups.rs
Last active February 27, 2023 21:10
From cassido's February 27, 2023 Newsletter
pub fn repeated_groups(numbers: &[u32]) -> Vec<Vec<u32>> {
numbers
.iter()
.fold::<Vec<Vec<u32>>, _>(vec![], |mut acc, &n| {
if let Some(last) = acc.last_mut() {
if last[0] == n {
last.push(n);
} else {
acc.push(vec![n]);
}
@frectonz
frectonz / missingBits.go
Last active January 23, 2023 16:13
From cassido's January 23, 2023 Newsletter
package main
import (
"fmt"
"strconv"
)
func main() {
val1 := missingBits([]int{1, 2, 3, 4, 20, 21, 22, 23})
fmt.Println(val1)
@JoelQ
JoelQ / elm-types-glossary.md
Last active June 26, 2024 03:05
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.