Skip to content

Instantly share code, notes, and snippets.

View abdorah's full-sized avatar
🏠
Working from home

Kotbi Abderrahmane abdorah

🏠
Working from home
View GitHub Profile
@abdorah
abdorah / feed.rss
Last active March 12, 2023 19:26
A nodeJs script that loops on a list of files and create a google podcasts rss feed file
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title></title>
<itunes:author></itunes:author>
<description></description>
<itunes:image href="link to a picture"/>
<language>ar</language>
<item>
@abdorah
abdorah / attributes.txt
Created November 8, 2022 22:09
Thymeleaf attributes
th:abbr
th:accept
th:accept-charset
th:accesskey
th:action
th:align
th:alt
th:archive
th:audio
th:autocomplete
@abdorah
abdorah / index.html
Created September 24, 2022 16:32
Inspatch
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<script src="store.js" defer type="module"></script>
<script src="script.js" defer type="module"></script>
@abdorah
abdorah / rules.md
Created December 2, 2021 12:42
Memento about RegEx

Regex Reference

Basics

  • / expression / flags, i.e /[A-Z]+/g basic format
  • / hello\?\*\\/ escape special characters with backslashes
  • () group with parentheses
  • | logical OR

Character classes

@abdorah
abdorah / cleancomments.js
Created September 29, 2021 09:57
How to write clean comments.js
/**
* @description This function generates the button required for Action Bar
* @author Ashish
* @param { Function } t => translation function
* @param { Object } history => contains previous state
* @param { Function } print => property passed from parent to print
* @returns { Array } buttons array of Objects
* @see {@link https://stackoverflow.com/users/5282407/ashish-singh-rawat }
* @todo Performance optimisation, removing multiple loops
* * BELOW ARE SOME MORE META DATA, that can be used
@abdorah
abdorah / Reshap.java
Last active September 5, 2021 22:04
How to reshape an int[][] matrix in java into int[] array?
package com;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Reshaper {
public int getRowsNumber(int[][] matrix) {
return matrix.length;
@abdorah
abdorah / abdorah.stl
Last active April 17, 2021 16:24
My Skyline for 2020
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abdorah
abdorah / Itoa.c
Last active November 16, 2023 08:31
This gist represents my implementation of the itoa function in c.
#include <stdio.h>
#include <stdlib.h>
typedef enum{false, true} bool;
void swap(char *a, char *b)
{
if(!a || !b)
return;
@abdorah
abdorah / JavaFunctionalProgramming.md
Last active March 1, 2023 05:47
This article will teach you functional programming in java.

Java Functional Programming

This article will take you to the next level in java. Are you ready!

Introduction

This article is basically a set of examples of multiple tools provided by Java 8. Those tools have helped to make programming way more easier and optimal(even in terms of hardware resources), using a declarative approach. Hence, we don't have to tell many details, but only what we want to achieve by our code. I should highlight also the fact that this pack of tools is something that a java developer "must" know.

Map

@abdorah
abdorah / HttpCrudRequests.js
Last active September 25, 2022 18:07
async fetch class that make it easy to perform http crud request in vanilla js.
class HttpCrudRequests {
async get(url) {
const res = await fetch(url)
const data = await res.json()
return data
}
async post(url, post) {
const res = await fetch(url, {