Skip to content

Instantly share code, notes, and snippets.

View gioiliop7's full-sized avatar
:octocat:
Hello

Giorgos Iliopoulos gioiliop7

:octocat:
Hello
View GitHub Profile
@gioiliop7
gioiliop7 / functions.php
Created December 7, 2024 21:18
[WORDPRESS,PHP] Sign a pdf with hashed username
function signPdf($attachmentId)
{
// Get the current user
$currentUser = wp_get_current_user();
$username = $currentUser->user_login;
$hashedUsername = hash('sha256', $username);
// Get the absolute server path of the attachment
$pdfPath = get_attached_file($attachmentId);
@gioiliop7
gioiliop7 / functions.php
Created December 7, 2024 21:14
[PHP] Convert EPSG2100 coordinates to WGS84 coordinates
function transformEPSG2100toWGS84($x, $y)
{
// EPSG:2100 parameters
$a = 6378137.0; // Semi-major axis
$f = 1 / 298.257222101; // Flattening
$e2 = 2 * $f - $f ** 2; // Square of eccentricity
$k0 = 0.9996; // Scale factor
$lambda0 = deg2rad(24); // Central meridian in radians
$E0 = 500000; // False easting
$N0 = 0; // False northing
@gioiliop7
gioiliop7 / BoxNowMapWidget.tsx
Last active December 7, 2024 23:29
[TYPESCRIPT,TAILWIND,REACT] - BoxNow Locker Selection React Component Widget
//Documentation there https://widget-v5.boxnow.gr/devs
import { useEffect, useRef, useState } from "react";
interface BoxNowMapWidgetProps {
onSelect: (selected: {
postalCode: string;
address: string;
lockerId: string;
lockerName: string;
}) => void;

Development and Enhancement of the Cloud-Based FOSSBot Platform - GSOC 2024

This is the final report of the work which was done as part of development of the Fossbot Platform @ GSOC24.

Google Summer of Code logo

Name: Giorgos Iliopoulos

Mentor: Christos Chronis

@gioiliop7
gioiliop7 / functions.php
Created September 18, 2023 16:36
[WORDPRESS][DOKAN] Create shortcode and display html with given id
<?php
// Define the custom shortcode function
function get_vendor_info_shortcode($atts)
{
// Extract the attributes from the shortcode
$atts = shortcode_atts(
array(
'id' => 0, // Default ID if not provided
),
$atts,
@gioiliop7
gioiliop7 / Loading.tsx
Created August 27, 2023 08:35
Loading component with tailwind css (typescript)
const Loading: React.FC = () => {
return (
<>
<div className="min-h-screen bg-gray-200 flex items-center justify-center" role="status">
<svg
aria-hidden="true"
className="w-29 h-20 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-black"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
@gioiliop7
gioiliop7 / DigitalClock.tsx
Created August 27, 2023 08:34
Create digital-clock in React typescript using tailwind.css
import React, { useState, useEffect } from "react";
const DigitalClock: React.FC = () => {
const [time, setTime] = useState(new Date());
useEffect(() => {
const interval = setInterval(() => {
setTime(new Date());
}, 1000);
@gioiliop7
gioiliop7 / Weather.jsx
Created August 27, 2023 08:29
[React][Javascript][Tailwind] Weather component with Open weather map api
import React, { useState, useEffect } from 'react';
const Weather = () => {
const [weatherData, setWeatherData] = useState(null);
useEffect(() => {
const fetchWeatherData = async () => {
const apiKey = 'API_KEY';
const place = 'Your Place';
const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${place}&units=metric&appid=${apiKey}`;
@gioiliop7
gioiliop7 / createNavigationLink.ts
Created August 27, 2023 08:21
[Typescript] Create navigation link for Google Maps
@gioiliop7
gioiliop7 / accents.js
Created May 24, 2023 06:09
Remove accents in greek string and make it capitalize
export function removeAccents(str) {
const upperCaseSeriousString = str.toUpperCase();
const greekLetters = {
Ά: "Α",
Έ: "Ε",
Ή: "Η",
Ί: "Ι",
Ϊ: "Ι",
Ό: "Ο",
Ύ: "Υ",