# If you have a two node cluster and can't reach quorum, set the expected vote to 1
pvecm expected 1
# Then delete
pvecm delnode [node]
This file contains hidden or 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 | |
namespace Tests\Unit; | |
use Tests\TestCase; | |
class ExampleTest extends TestCase | |
{ | |
public function testGuzzleBatch() | |
{ |
This file contains hidden or 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 | |
DB::listen( | |
function ($sql) { | |
foreach ($sql->bindings as $i => $binding) { | |
if ($binding instanceof \DateTime) { | |
$sql->bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); | |
} else { | |
if (is_string($binding)) { | |
$sql->bindings[$i] = "'$binding'"; |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
# Install: | |
# wget https://gist.githubusercontent.com/gjrdiesel/59cdc51b74fa96685b713ed23f4ef6d0/raw/Downloader.php -O /usr/local/bin/dl | |
# chmod +x /usr/local/bin/dl | |
if(!isset($argv[1])){ | |
echo "Downloader: This downloads the full URL and makes a matching file structure\n"; | |
die("Usage: dl [url]"); | |
} |
This file contains hidden or 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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
This file contains hidden or 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 | |
if(!isset($argv[1]) || strlen($argv[1]) < 5){ | |
echo 'usage php optimize.php "https://gtmetrix.com/reports/***YOUR_URL_HERE***/**YOUR_REPORT_ID_HERE**"'; | |
die(); | |
} | |
$full_url = $argv[1]; | |
$domain = strstr(str_replace('https://gtmetrix.com/reports/','',$full_url),'/',true); | |
$content = file_get_contents($full_url); |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# README | |
# | |
# 1) Download this file `wget gisturl/` | |
# 2) Copy the file to bin `mv ~/Downloads/wp-install.sh /usr/local/bin/wp-install` | |
# 3) Set proper file permissions `chmod +x /usr/local/bin/wp-install` | |
# 4) Now you can use the command to start a fresh wordpress install right away | |
# `wp-install my-new-test-site` |
This file contains hidden or 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 convert(name) { | |
if (!ga) return; | |
var tracker = ga.getAll()[0]; | |
tracker.send("event", name); | |
} | |
document.addEventListener('wpcf7submit', function (event) { | |
convert(event.detail.contactFormId); | |
}); | |
document.querySelector('a[href^="tel:"]').onclick = function () { | |
convert('clicked-call') |
This file contains hidden or 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 | |
## Usage: wp-create [site-name] | |
SITENAME=$1 | |
cd ~/git/; | |
mkdir $SITENAME | |
cd ~/git/$SITENAME; |
This file contains hidden or 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 /* Template Name: Portfolio */ ?> | |
<?php get_header(); ?> | |
<?php | |
$thumb_id = get_post_thumbnail_id(); | |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); | |
$thumb_url = $thumb_url_array[0]; | |
if( have_posts() ){ |