Skip to content

Instantly share code, notes, and snippets.

@cladjidane
cladjidane / WampHTTPS.md
Created March 24, 2023 11:10 — forked from danieldogeanu/WampHTTPS.md
How to enable HTTPS for WAMP Server.

After you've downloaded and installed WAMP Server, follow these steps:

  1. Generate SSL certificate using OpenSSL:
  • Add C:\wamp64\bin\apache\apache2.4.27\bin directory to the PATH so you can access openssl command from the command prompt (WAMP comes with its own version of OpenSSL already integrated, so you don't need to install it. You'll find it in this directory.).

    IMPORTANT: Please note that the path of your installation depends on your version of Apache! DO NOT copy and paste the paths presented in this gist as they will not match with yours!

  • Navigate to your user directory (C:\Users\%YOUR_USERNAME%\), create a new folder (.openssl), navigate to it with Powershell and run these commands:

    openssl genrsa -aes256 -out private.key 2048
    

openssl rsa -in private.key -out private.key

@cladjidane
cladjidane / README.md
Created June 14, 2021 09:19 — forked from premitheme/README.md
Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

Recover MAMP MySQL database using .frm and .ibd files after InnoDB crash

After a power faliur (also can be a sudden restart or system crash), I ended up with corrupted database and lost the access to my local hosted websites for development. Even the MAMP's MySQL server was not starting.

Preparation

You will need to find the databases folders, in case of MAMP they are located in Applications/MAMP/db/mysql56 (or mysql57 depending on MySQL version).

You will find folders containing the database name, inside them you will find .frm and .ibd files. Take a copy of the entire folder for backup in another place, the desktop for example.

@cladjidane
cladjidane / child-theme-functions-php.php
Created February 19, 2021 09:10 — forked from lots0logs/child-theme-functions-php.php
WordPress :: Divi Builder :: Post Slider :: Display projects instead of posts.
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Post_Slider' ) ) {
get_template_part( 'my-main-modules' );
add_filter( 'my_et_post_slider_args', 'my_et_post_slider_args_cb' );
$et_pb_post_slider = new My_ET_Builder_Module_Post_Slider();
remove_shortcode('et_pb_post_slider');
@cladjidane
cladjidane / connectHTMLelements_SVG.png
Created September 22, 2020 08:24 — forked from alojzije/connectHTMLelements_SVG.png
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png
@cladjidane
cladjidane / ComponentIndex.js
Created August 5, 2018 14:07 — forked from davidgljay/ComponentIndex.js
Pattern for dynamically loading React components based on a config json object.
import config from '../config'
let components = {}
//For each component in the config fiel into an object
for (var i = config.length - 1; i >= 0; i--) {
components[config[i].name] = require(config[i].path).default
}
export default components
@cladjidane
cladjidane / README.md
Created July 27, 2018 07:52 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@cladjidane
cladjidane / iframe.html
Created July 27, 2018 06:24 — forked from cirocosta/iframe.html
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">