This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Set our Old and New URLS */ | |
SET @oldurl := "http://www.oldsite.com"; | |
SET @newurl := "http://www.newsite.com"; | |
/* Replaces URL in WordPress Home and Site URL in wp_options */ | |
UPDATE wp_options SET option_value = replace(option_value, @oldurl, @newurl) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
/* Replaces URL in GUID of all posts/cpt/etc */ | |
/* https://deliciousbrains.com/wordpress-post-guids-sometimes-update/ */ | |
UPDATE wp_posts SET guid = replace(guid, @oldurl, @newurl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@php | |
$d = $d ?? null; // default value | |
@endphp | |
<div class="form-group row"> | |
<label for="{{ $n }}" class="col-sm-4 col-form-label text-md-right"><b>{{ $l }}</b></label> | |
<div class="col-md-8"> | |
<input id="{{ $n }}" type="checkbox" class="form-control" name="{{ $n }}" value="1" @if(old($n, $d) == '1') checked @endif> | |
@if ($errors->has($n)) | |
<small class="text-danger">{{ $errors->first($n) }}</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ){ | |
$.fn.observe = function( callback, options ) { | |
var settings = $.extend( { | |
attributes: true, | |
childList: true, | |
characterData: true | |
}, | |
options ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Require the library | |
*/ | |
require 'PHPTail.php'; | |
/** | |
* Initilize a new instance of PHPTail | |
* @var PHPTail | |
*/ | |
$tail = new PHPTail("/path/to/log"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ADD NEW ADMIN USER TO WORDPRESS | |
// ---------------------------------- | |
// Put this file in your Wordpress root directory and run it from your browser. | |
// Delete it when you're done. | |
// Original script by Joshua Winn - https://joshuawinn.com/create-a-new-wordpress-admin-user-from-php | |
require_once('wp-blog-header.php'); | |
require_once('wp-includes/registration.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var mysqlBackup = require('./mysql-backup'); | |
var schedule = require('node-schedule'); | |
schedule.scheduleJob({ hour: 22, minute: 0 }, mysqlBackup); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// requiring autoload with the pluguin | |
require __DIR__ . '/../../vendor/autoload.php'; | |
// invoking needed classes | |
use PhpOffice\PhpSpreadsheet\Spreadsheet; //class responsible to change the spreadsheet | |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; //class that write the table in .xlsx | |
$spreadsheet = new Spreadsheet(); //instanciando uma nova planilha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
api: | |
image: alterway/php:5.4-apache | |
environment: | |
PHP_php5enmod: 'mysqli' | |
HTTPD_a2enmod: 'rewrite headers' | |
volumes: | |
# ./api contains my PHP application | |
- "./api:/var/www/html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Enable Zend OPcache extension module | |
zend_extension=opcache.so | |
; Determines if Zend OPCache is enabled | |
opcache.enable=1 | |
; Determines if Zend OPCache is enabled for the CLI version of PHP | |
;opcache.enable_cli=0 | |
; The OPcache shared memory storage size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to backup all mysql tables as separate files | |
# | |
# $BACKUP_PATH/<date>/<db_name>/<host>_<table_name>.gz | |
# MySQL settings | |
MYSQL_USER="root" | |
MYSQL_PASS="" | |
MYSQL_HOST="localhost" |
OlderNewer