Skip to content

Instantly share code, notes, and snippets.

View ApoGouv's full-sized avatar
🚧
work in progress

Apostolos Gouvalas ApoGouv

🚧
work in progress
View GitHub Profile
@ApoGouv
ApoGouv / UdemyCourseNotesHelpers.md
Last active April 3, 2025 06:56
Udemy course content info to markdown

Introduction:

This document provides a collection of helper classes and functions designed to streamline the note-taking process while taking a Udemy course. These utilities are focused on extracting and organizing key course information to help you consolidate your notes efficiently. The functionalities include:

  1. UdemyCourseCurriculumExtractor: A class that extracts essential information from a Udemy course landing page, such as the course title, section titles, and subcontent titles. It then formats this data in markdown, allowing you to easily capture and organize your course notes.

  2. UdemyTranscriptCopier: An object that adds a floating button to the page, enabling you to quickly copy the transcript of the currently playing Udemy course to the clipboard. This functionality is useful when you need to capture course transcripts for further note-taking or review.

These helpers are designed to enhance your learning experience by simplifying the process of gathering and organizing c

@ApoGouv
ApoGouv / js-scripts.md
Created March 28, 2021 05:57
JS scripts for common and not only solutions

jQuery - Add support for passive event listeners

| There is an open issue here: jquery/jquery#2871

// Passive event listeners
jQuery.event.special.touchstart = {
    setup: function( _, ns, handle ) {
 this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
@ApoGouv
ApoGouv / css_crafts.md
Created September 22, 2020 08:43
CSS snippets

Show an indicator and change the horizontal scrollbar styles when using the BootStrap .table-responsive class.

We change the styling of the horizontal scrollbar in our responsive table and also add a text indicating that the user can scroll horizontaly. The Text indicator is only visible in mobile devices.

/* BS Responsive table indicator */
::-webkit-scrollbar {
    height: 6px;            /* height of horizontal scrollbar */
    border: 1px solid #333; /* border of horizontal scrollbar */
    background: #333;       /* bg color of horizontal scrollbar */
@ApoGouv
ApoGouv / pivot-tables.md
Created March 8, 2020 15:01 — forked from Braunson/pivot-tables.md
Laravel 6.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

@ApoGouv
ApoGouv / wc_cart_changes.php
Last active April 5, 2019 06:52
Woocommerce Functions for mods
<?php
/************************************************************************
* Changes the redirect URL for the Return To Shop button in the cart.
***********************************************************************/
function cds_wc_empty_cart_redirect_url() {
return 'https://www.example.gr/some/custom/url';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'cds_wc_empty_cart_redirect_url', 20 );
@ApoGouv
ApoGouv / 00_wp-optimizations-security-n-cleanup.md
Last active September 7, 2024 11:35
WP - Optimizations, Security hardening and Cleanup.

** WP - Optimizations, Security hardening and Cleanup **

Here you can find a a list of WP optimization and cleanup functions and methodology.

1.  .htaccess
  ** Security **
- Disable the server signature
- Disable directory browsing
- Force https to your site.

Linux commands related to file permissions

To change all the directories to 755 (drwxr-xr-x):

find /opt/lampp/htdocs -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r--r--):

@ApoGouv
ApoGouv / php_pretty_print_data_for_debug.md
Last active March 20, 2024 10:09
PHP - Pretty print data for debugging.

Print readable (copy/paste ready) code

echo '<pre>' . var_export($data, true) . '</pre>';

OR

with syntax highlighting

@ApoGouv
ApoGouv / wp-print-vars-in-footer-admin-only.php
Last active October 18, 2018 07:26
WordPress scripts for functions.php file
@ApoGouv
ApoGouv / gitcom.md
Created September 30, 2018 07:13 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init