Skip to content

Instantly share code, notes, and snippets.

View Steveorevo's full-sized avatar

Stephen J. Carnam Steveorevo

View GitHub Profile
@Steveorevo
Steveorevo / wp-config.php
Created July 12, 2012 10:54
Sync DesktopServer local/live wp-config.php without overwrite worries
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@Steveorevo
Steveorevo / install.php
Last active April 6, 2016 07:08
Automate your WordPress installation with this WordPress "drop in" (goes in your wp-contents folder).
<?php
echo 'This has been customized!!!';
// Perform post-install customizations
if ( function_exists( 'add_action' ) ){
add_action( 'wp_mail_content_type' , 'customize_install' );
function customize_install(){
// Switch themes
switch_theme('twentytwelve');
<?php
/**
* Place next to wp-blog-header.php. Visit this file to find the time suck.
*/
declare(ticks=1);
register_tick_function('ds_do_profile');
$ds_profile = array();
$ds_last_time = microtime(true);
@Steveorevo
Steveorevo / apt-cyg
Created February 18, 2016 20:50
apt-cyg with lynx fallback
#!/bin/bash
# apt-cyg: install tool for Cygwin similar to debian apt-get
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Trans-code Design
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@Steveorevo
Steveorevo / draftcode.php
Created March 7, 2017 07:21
Suggested DraftCode fix.
<?php
if ( !class_exists( 'DraftCode' ) ) {
/**
* Our DraftCode class fixes WordPress compatibility issues.
*/
class DraftCode
{
public function __construct()
{
global $wp_filter;
@Steveorevo
Steveorevo / .gitignore
Last active February 1, 2018 05:39
NRG Web Server
*.backup
.DS_Store
@Steveorevo
Steveorevo / index.php
Last active March 25, 2023 06:32
The twenty twenty two index.php + generic/minimalist php template support
<?php
// There is nothing output here because block themes do not use php templates.
// There is a core ticket discussing removing this requirement for block themes:
// https://core.trac.wordpress.org/ticket/54272.
?><!DOCTYPE html>
<html>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="stylesheet" href="<?php echo esc_url( get_stylesheet_uri() ); ?>" type="text/css" />
@Steveorevo
Steveorevo / gist:7510cc8c718dbb22f8a062271a66109e
Last active August 18, 2022 07:36
Determine if a Node-RED node is enabled and all of its subflow parents and subsequent tab
/**
* isNodeEnabled checks to see if the given node is enabled and is in an enabled tab
* and/or subflow instance (vs just in the palette); checks it's parents/ancestors.
*
* @param {object} RED The RED object for accessing nodes.
* @param {string} node_id The node ID to check for a valid instance.
* @return {boolean} True if the node is a valid enabled instance, false otherwise.
*/
function isNodeEnabled(RED, node_id) {
@Steveorevo
Steveorevo / var-styles.js
Created September 1, 2022 06:20
JavaScript style camelcase to PHP style underscore and back
// Underscore to camelcase
function usToCC(str) {
return str.replace(/_([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
// Camelcase to underscore
function ccToUs(str) {
return str.replace(/([a-z][A-Z])/g, function (g) { return g[0] + '_' + g[1].toLowerCase() });
}
@Steveorevo
Steveorevo / gist:e31b2b8e207c83625245e92049e49762
Created September 2, 2022 00:57
Wild card domain renewal using let’s encrypt
certbot certonly --manual \
--preferred-challenges=dns \
--email admin@website.com \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
--manual-public-ip-logging-ok \
-d website.com \
-d *.website.com \