Skip to content

Instantly share code, notes, and snippets.

View frectonz's full-sized avatar
❄️

Fraol Lemecha frectonz

❄️
View GitHub Profile
{
"data": {
"completeSubmissionProcessing": {
"success": false,
"error_message": "exception {'message': \"field '_set' not found in type: 'Submission_set_input'\", 'extensions': {'path': '$.selectionSet.update_Submission_by_pk.args._set._set', 'code': 'validation-failed'}} when making gql query\nmutation CompleteClientSubmissionProcessing($id: Int!, $set: Submission_set_input!) {\n update_Submission_by_pk(pk_columns: {id: $id}, _set: $set) {\n id\n sg_playlist_id\n status\n error_message\n SubmissionRows {\n id\n error_message\n sg_version_id\n status\n SubmissionRowFiles {\n id\n error_message\n sg_published_file_id\n status\n SubmissionRowFileLocations {\n id\n error_
use calculator::Calculator;
use clap::Parser;
use db::InMemory;
use futures::{future::poll_fn, SinkExt, StreamExt};
use tokio::{
net::{TcpListener, TcpStream},
sync::mpsc,
};
use tokio_stream::wrappers::UnboundedReceiverStream;
use tokio_tungstenite::tungstenite::Message as WsMessage;

Comments on The Ethiopian Startup Proclamation

Generally, I think the document is very well-prepared and addresses most of the important problems that startups face in their early stages.


1. On the Annual Competition

image

{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
packages = [
pkgs.elixir
pkgs.exercism
pkgs.elixir-ls
] ++
# Linux only
pkgs.lib.optionals pkgs.stdenv.isLinux [
@frectonz
frectonz / between-nums.lisp
Last active November 22, 2023 06:43
From cassidoo's November 20, 2023 newsletter
(defun range (x y)
(let ((start (min x y)) (end (max x y)))
(loop for i from start to end
collect i)))
(defun primep (num)
(cond
((<= num 1) nil)
((= num 2) t)
(t
@frectonz
frectonz / lexo_next.rs
Last active October 31, 2023 12:55
From cassidoo's October 30, 2023 newsletter
use itertools::Itertools;
pub fn lexo_next(num: usize) -> usize {
let digits = digits(num);
let mut perms = digits
.iter()
.permutations(digits.len())
.map(number)
.filter(|perm| *perm != num)
pub type Grid = Vec<Vec<u8>>;
pub fn grid_perimeter(grid: Grid) -> usize {
grid.iter()
.enumerate()
.map(|(i, row)| {
row.iter()
.enumerate()
.filter_map(|(j, cell)| if *cell == 1 { Some(j) } else { None })
.map(|j| {
def island_perimeter(grid):
perimeter = 0
for i in range(len(grid)):
row = grid[i]
for j in range(len(row)):
cell = grid[i][j]
if cell != 1:
continue
@frectonz
frectonz / is_isomorphic.rs
Last active October 18, 2023 10:04
From cassidoo's October 18, 2023 newsletter
fn is_isomorphic(s1: &str, s2: &str) -> bool {
let mask1 = str_mask(s1);
let mask2 = str_mask(s2);
mask1 == mask2
}
fn str_mask(s: &str) -> Vec<usize> {
s.chars()
.fold((None, Vec::<usize>::new()), |(last_c, mut acc), curr_c| {
@frectonz
frectonz / faultyKeeb.ts
Created August 14, 2023 08:43
From cassidoo's August 14, 2023 newsletter
function faultyKeeb(str: string): string {
const out = [];
const vowels = ["a", "e", "i", "o", "u"];
for (const ch of str) {
if (vowels.includes(ch)) {
out.reverse();
} else {
out.push(ch);
}
}