Skip to content

Instantly share code, notes, and snippets.

View Archie22is's full-sized avatar
💭
I may be slow to respond.

ᴀʀᴄʜɪᴇ ᴍᴀᴋᴜᴡᴀ™ Archie22is

💭
I may be slow to respond.
View GitHub Profile
@Archie22is
Archie22is / html.html
Created August 10, 2022 11:56
How can I show three columns per row – using flex?
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
@Archie22is
Archie22is / blah.bash
Created July 29, 2022 06:23
The “fatal: refusing to merge unrelated histories” Git error
###############################################################################################
# https://www.educative.io/answers/the-fatal-refusing-to-merge-unrelated-histories-git-error
#
# The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated
# projects are merged (i.e., projects that are not aware of each other’s existence and
# have mismatching commit histories).
#
# The error is resolved by toggling the allow-unrelated-histories switch.
# After a `git pull` or `git merge` command, add the following tag:
#
@Archie22is
Archie22is / custom-block.php
Created July 28, 2022 06:56
How to create a new WPBakery component
<?php
if ( ! class_exists( 'VcSodaBlockquote' ) ) {
class VcSodaBlockquote extends WPBakeryShortCode {
//Initialize Component
function __construct() {
add_action( 'init', array( $this, 'create_shortcode' ), 999 );
add_shortcode( 'vc_soda_blockquote', array( $this, 'render_shortcode' ) );
@Archie22is
Archie22is / function.php
Created July 28, 2022 06:43
Include WPBakery in a Custom theme
<?php
/**
* https://kb.wpbakery.com/docs/theme-integration-technical/theme-integration-technical/
* Include the TGM_Plugin_Activation class.
*/
require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'my_theme_register_js_composer_plugins' );
/**
* Register the required plugins for this theme.
*
@Archie22is
Archie22is / cleanup.php
Created July 27, 2022 06:06
Clean up WordPress theme (remove emojis and other useless dashboard widgets) #WorkInProgress
<?php
/**
* Cleanup
*
*/
/**
* Less stuff in <head>
*
@Archie22is
Archie22is / svg-support.php
Created July 25, 2022 11:30
Enable SVG Support in WordPress
<?php
// Allow SVG (add to functions.php)
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {
global $wp_version;
if ( $wp_version !== '4.7.1' ) {
return $data;
}
$filetype = wp_check_filetype( $filename, $mimes );
@Archie22is
Archie22is / awesome-php.md
Created July 21, 2022 14:11 — forked from RKAN/awesome-php.md
# Awesome PHP A list of amazingly awesome PHP libraries, resources and shiny things.

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@Archie22is
Archie22is / facts.txt
Created July 21, 2022 06:47
React or Angular – By: Robert Polevoi (Quora)
Anyone who decides between adopting Angular and React on the basis of github stars or any other measure of popularity should definitely stick to React. Angular will never win a popularity contest, especially one conducted with people who do not have the deep exposure to it necessary to assess its value to your career.
And if you have any trouble figuring out the version issues with Angular you should absolutely stay away from it. Angular (meaning 2+, currently version 4, and not AngularJS) is so intellectually challenging, so much only for the big kids, that if you have the slightest doubts, don’t bother. This is partly because of Angular itself, but far more because learning Angular means also mastering Typescript (compiled, type-safe JS) and RXJS (functional reactive programming). RXJS in particular is only for the very serious developer with the mental chops for it, representing a sea change in the fundamental approach to async programming.
It took me well over a year of full time effort to get to where
@Archie22is
Archie22is / ajax.php
Created July 20, 2022 15:14
Display JSON data with jQuery Ajax?
<?php
$.ajax({
url: "https://raw.githubusercontent.com/RichmondDay/public/master/test_vehicle_inventory_data.json",
method: "GET",
dataType: 'json',
success: function(data) {
console.log(typeof(data));
var html_to_append = '';
$.each(data, function(i, item) {
# Whitelist All of Cloudflare’s IP Addresses to
# mitigate Error 521 reported by Ahrefs
order deny,allow
allow from 173.245.48.0/20
allow from 103.21.244.0/22
allow from 103.22.200.0/22
allow from 103.31.4.0/22
allow from 141.101.64.0/18
allow from 108.162.192.0/18
allow from 190.93.240.0/20