Skip to content

Instantly share code, notes, and snippets.

View yskooo's full-sized avatar
🦅
you got this!

Harold Martin Patacsil yskooo

🦅
you got this!
View GitHub Profile
@yskooo
yskooo / Take a Ten Minutes Walk.ts
Created August 6, 2023 08:01
Codewars: Kata Training() - You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided to take the opportunity to go for a short walk. The city provides its citizens with a Walk Generating App on their phones -- everytime you press the button it sends you a…
export function isValidWalk(walk: string[]) {
const directions: { [key: string]: number } = {
n: 0,
s: 0,
w: 0,
e: 0,
};
walk.forEach((el) => (directions[el] += 1));
@yskooo
yskooo / qwikstart.c
Created August 6, 2023 06:37
Basic CRUD app with C + Apache Cassandra with explanations for beginners
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cassandra.h>
// Define a structure to represent user information
struct Users_ {
const char* lastname;
coss_int32_t age;
@yskooo
yskooo / clean_code.md
Created July 2, 2023 08:00 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@yskooo
yskooo / ProfileMenu.tsx
Created June 25, 2023 01:00 — forked from adrianhajdin/ProfileMenu.tsx
Build and Deploy a Full Stack Next.js 13 Application | React, Next JS 13, TypeScript, Tailwind CSS
"use client"
import Link from "next/link";
import Image from "next/image";
import { signOut } from "next-auth/react";
import { Fragment, useState } from "react";
import { Menu, Transition } from "@headlessui/react";
import { SessionInterface } from "@/common.types";
@yskooo
yskooo / App.js
Created May 29, 2023 14:50
React Native To Do List
import React, {useState} from 'react';
import { KeyboardAvoidingView, StyleSheet, Text, View, TextInput, TouchableOpacity, Keyboard, ScrollView } from 'react-native';
import Task from './components/Task';
export default function App() {
const [task, setTask] = useState();
const [taskItems, setTaskItems] = useState([]);
const handleAddTask = () => {
Keyboard.dismiss();