Skip to content

Instantly share code, notes, and snippets.

View BlazeIsClone's full-sized avatar
🔥
Blazzing

Sandev Abeykoon BlazeIsClone

🔥
Blazzing
View GitHub Profile
@tinotriste
tinotriste / breadcrumbs-functions.php
Last active July 1, 2024 14:40
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
@esfand
esfand / NginxRedirect.md
Last active March 21, 2024 07:12
Nginx Redirect

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

@BFTrick
BFTrick / install-wp.sh
Last active April 1, 2024 04:14
Download & Install WordPress via Curl
curl -O https://wordpress.org/latest.zip
unzip latest.zip
mv wordpress site
rm latest.zip
@iansheridan
iansheridan / how_to_gen_ssl_cert.md
Created July 22, 2014 14:11
How to generate an SSL CSR or self signed SSL certificate

How to generate an SSL CSR or self signed SSL certificate

Overview

The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process.

Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser).

SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring

@omurphy27
omurphy27 / Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML.php
Last active September 16, 2021 05:52
Bootstrap Tabs used with Advanced Custom Fields ACF PHP JS HTML
<?php if( have_rows('tabs') ): ?>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?>
<?php
$string = sanitize_title( get_sub_field('tab_title') );
?>
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> >
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a>
</li>
<?php $i++; endwhile; ?>
@key-amb
key-amb / Makefile
Created April 14, 2016 03:55
Makefile to update git repository with submodules
.PHONY: update update-all all
update:
git pull origin master
git submodule update --init
update-all: update
git submodule foreach git pull origin master
all: update-all
@kellenmace
kellenmace / taxonomy-dropdown-template.php
Created September 23, 2016 20:21
WordPress Taxonomy Dropdown Template
<div class="tools-dropdown">
<form id="tool-category-select" class="tool-category-select" method="get">
<?php
// Create and display the dropdown menu.
wp_dropdown_categories(
array(
'orderby' => 'NAME', // Order the items in the dropdown menu by their name.
'taxonomy' => 'tools', // Only include posts with the taxonomy of 'tools'.
@kellenmace
kellenmace / taxonomy-dropdown-functions.php
Created September 23, 2016 20:22
WordPress Taxonomy Dropdown Functions
<?php
/**
* Get tools, filtered by the taxonomy term, if one was selected.
*
* @return WP_Query Tools in the taxonomy term if one was selected, else all.
*/
function km_get_tools_in_taxonomy_term() {
return new WP_Query( array(
@KeithYeh
KeithYeh / Self-Signed SSL with SAN.md
Created October 14, 2017 13:12
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*