Skip to content

Instantly share code, notes, and snippets.

View Luc45's full-sized avatar
💭
The most important thing about tests is writing testable code.

Lucas Luc45

💭
The most important thing about tests is writing testable code.
View GitHub Profile
@Luc45
Luc45 / FilezillaToLastPass.php
Last active November 3, 2017 15:39
Export Filezilla servers and Import it to LastPass
<?php
/**
* Paste your C:\Users\{user}\AppData\Roaming\FileZilla\sitemanager.xml on $string
*/
$string = '<?xml version="1.0"?>
<FileZilla3 version="3.28.0" platform="windows">
<Servers>
<Server>
<Host>something.com</Host>
@Luc45
Luc45 / bootstrap-desktop.css
Created April 1, 2018 03:47
Bootstrap 4 Desktop CSS for screens larger than 1600px
/*
* CSS file with Bootstrap 4 grid classes for screens bigger than 1600px. Just add this file after the Bootstrap CSS file and you will be able to juse col-desktop, hidden-desktop, etc.
*
* Author: Lucas Bustamante (adapted to Bootstrap 4.0)
* Site: lucasbustamante.com.br
*
* Author: Marc van Nieuwenhuijzen (original file)
* Company: WebVakman
* Site: WebVakman.nl
*
@Luc45
Luc45 / wordpress-actions.php
Created May 23, 2019 10:41
Array of all actions in WordPress, in order of execution
<?php
// As seen on https://codex.wordpress.org/Plugin_API/Action_Reference
$actions = [
'muplugins_loaded',
'registered_taxonomy',
'registered_post_type',
'plugins_loaded',
'sanitize_comment_cookies',
'setup_theme',
'load_textdomain',
@Luc45
Luc45 / serve-wordpress-multisite.sh
Created December 22, 2018 15:36
WordPress Multisite serve script for Nginx (Homestead, etc)
#!/usr/bin/env bash
block="# WordPress multisite subdirectory rules.
# Designed to be included in any server {} block.
map \$uri \$blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) \$blogpath ;
}
map \$blogname \$blogid {
default -999;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body id="delayBody">
Visible after timeout
<script id="jsbin-javascript">
@Luc45
Luc45 / woocommerce-enable-hpos.php
Last active December 13, 2023 13:22
WooCommerce Enable COT - Q4 2023
<?php
/**
* Plugin Name: WooCommerce Enable COT
* Description: Adds the code to enable Custom Order Tables.
* Version: 0.0.4
*/
function wc_enable_cot() {
/** @var \Automattic\WooCommerce\Internal\Features\FeaturesController $features_controller */
$features_controller = wc_get_container()->get( 'Automattic\WooCommerce\Internal\Features\FeaturesController' );