Skip to content

Instantly share code, notes, and snippets.

View tudorilisoi's full-sized avatar

Tudor Ilisoi tudorilisoi

View GitHub Profile
@tudorilisoi
tudorilisoi / poezii.md
Created November 18, 2026 11:27
poezii

=== Pentru Dorina Gavriluță, vie în visele mele

Da, mama mă iubește! Nu poate adormi de lumina zâmbetului meu Gătește întotdeauna o porție în plus, chiar dacă trec rar pe-acasă Plânge, dar nu spune, că necazuri oricum se găsesc peste tot Suspină, întreabă cu o bucurie pe care eu încă nu o știu: „A! ți-ai dat demisia?” Pentru ea sunt un rege, nicidecum un cal Scrutinează draconic o fată pe care eu am judecat-o doar cu vederea.

@tudorilisoi
tudorilisoi / deploy.sh
Created October 19, 2026 13:05
deploy APK to OTA
#!/bin/bash
set -e
# 1. Parse pubspec.yaml version
VERSION=$(grep '^version: ' pubspec.yaml | head -n1 | awk '{print $2}')
if [ -z "$VERSION" ]; then
echo "Error: Version not found in pubspec.yaml"
exit 1
fi
@tudorilisoi
tudorilisoi / pmpm.md
Last active April 3, 2026 10:34
Poor man's project management

e3

Setup

  • fork the repo https://github.com/tudorilisoi/blitz-e4
  • git clone your fork on to your machine
  • git add remote origin https://github.com/tudorilisoi/blitz-e4
  • install node v18.18.0, then run npm i -g yarn
  • run yarn install
  • run npx blitz prisma migrate dev to create the database
@tudorilisoi
tudorilisoi / route.ts
Created April 15, 2024 08:15
@conform with zod and zenstack
// schema
import { z } from 'zod'
// structure for a blog post
export const postCreateSchema = z.object({
title: z
.string({ required_error: 'Title is required' })
.min(10, 'Title is too short'),
body: z
.string({ required_error: 'Body is required' })
@tudorilisoi
tudorilisoi / index.js
Last active February 10, 2023 06:52
faker generate persons
import { faker } from '@faker-js/faker';
const MAX = 100
const users = []
const departaments = 'bridge engine'.split(' ')
for (let i = 0; i < MAX; i++) {
let firstName = faker.name.firstName();
let lastName = faker.name.lastName();
const user = {
name: firstName + ' ' + lastName,
let num = 0 //declare a variable whose initial value is zero
//function declaration
function increaseNum(){
num++ //increase the value of num by 1 using the increment operator
//get the reference to the body element
let bodyElement = document.getElementsByTagName('body')[0]
//... and set its text value to the value of num
@tudorilisoi
tudorilisoi / js-object-creation.js
Last active October 13, 2020 16:23
JS constructor, factory, class
//*** Object creation
// 1) class syntax , usage: p = new Person('Rex')
class Person {
constructor(name) {
this.name = name
}
sayHello() {
@tudorilisoi
tudorilisoi / fibo.js
Created October 2, 2020 18:49
Fibonacci
let i = 1 //step
//this implementation computes the sequence as an array
function fib(n) {
if (n === 1) {
return [1, 1]
}
const prev = fib(n - 1)
const rl = prev.length
@tudorilisoi
tudorilisoi / splitter.js
Created October 2, 2020 18:23
Rescursive string splitting
/*
Write a recursive function that splits a string based on a separator (similar to String.prototype.split).
Don't use JS array's split function to solve this problem.
Input: 02/20/2020
Output: ["02", "20", "2020"]
https://courses.thinkful.com/dsa-v1/checkpoint/2
@tudorilisoi
tudorilisoi / knex_join_vs_procedural.js
Created September 4, 2020 19:10
Knex procedural sequence vs join
try {
// queries sequence
const topicIDs = await knex('topics_users').select('topic_id').where('user_id', userID)
const topics = await knex('topics').select('*').where('id', topicIDs)
//single query
const topicsInOneGo = await knex('topics').select('*')
.innerJoin('topics_users', 'topics_users.id', 'topics.id')
.where('topics_users.user_id', topicIDs)