A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
@echo off | |
:: Get current user's session ID | |
for /f "tokens=1,2,3 delims= " %%i in ('query session ^| findstr "%USERNAME%"') do set SessionId=%%k | |
:: Reconnect the session to the console | |
Tscon %SessionId% /Dest:console | |
:: Restart Windows Explorer | |
taskkill /f /im explorer.exe |
# Plex duplicate finder for PowerShell written by Sean W. https://cybersholt.com | |
# Copyright (c) 2023 Sean W. <cybersholt@gmail.com> All rights reserved. | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
# SPDX-License-Identifier: BSD-3-Clause | |
# Function to test connectivity to the Plex server | |
Function Test-PlexConnectivity { | |
param( | |
[string]$server, |
#!/bin/bash | |
# need to have bsdtar installed to get it on raspberry pi | |
# sudo apt install libarchive-tools | |
# Use \033 if you need OS X compatibility | |
# e.g. RED='\033[0;31m' && echo -e ${RED}"My red text"... | |
# Reset | |
Color_Off='\e[0m' # Text Reset |
class Software { | |
[string]$Name | |
[string]$Id | |
[string]$Version | |
[string]$AvailableVersion | |
} | |
# This fixes the character encoding issue | |
[System.Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() |
SELECT wpp.post_title, wpp.ID, wpp.post_date, mt1.meta_value as focus_keyword, | |
REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, '%year%', DATE_FORMAT(wpp.post_date,'%Y') ), '%monthnum%', DATE_FORMAT(wpp.post_date, '%m') ), '%day%', DATE_FORMAT(wpp.post_date, '%d') ), '%postname%', wpp.post_name ) AS permalink | |
FROM wp_posts wpp | |
LEFT JOIN wp_postmeta AS mt1 ON (wpp.ID = mt1.post_id AND mt1.meta_key='_yoast_wpseo_focuskw') | |
JOIN wp_options wpo | |
ON wpo.option_name = 'permalink_structure' | |
WHERE wpp.post_type = 'post' | |
AND wpp.post_status = 'publish' | |
ORDER BY wpp.post_date DESC; |
<?php | |
add_action( 'elementor_pro/forms/validation', function ( $record, $ajax_handler ) { | |
$email = $record->get_field( [ 'id' => 'email' ] ); | |
if ( $email ) { | |
if ( ! filter_var( $email['email']['value'], FILTER_VALIDATE_EMAIL ) ) { | |
$ajax_handler->add_error( $email['email']['id'], 'The email address is invalid.' ); | |
} | |
} | |
}, 10, 2 ); |
<?php | |
function s3Ranger($key) | |
{ | |
// inspired by https://stackoverflow.com/a/4635991/2320760 | |
$s3 = new S3Client( | |
array( | |
'version' => 'latest', | |
'region' => 'us-east-1', | |
'credentials' => [ | |
'key' => $key, |
<?php | |
// Original @ https://stackoverflow.com/questions/14559371/symfony2-video-streaming | |
use SplFileInfo; | |
use RuntimeException; | |
// Symfony >= 2.1 | |
use Symfony\Component\HttpFoundation\StreamedResponse; | |
public function streamAction($fileName) { |
<?php | |
private function getErrorMessages(\Symfony\Component\Form\Form $form) { | |
$errors = array(); | |
if ($form->hasChildren()) { | |
foreach ($form->getChildren() as $child) { | |
if (!$child->isValid()) { | |
$errors[$child->getName()] = $this->getFormErrors($child); | |
} |