Skip to content

Instantly share code, notes, and snippets.

@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:04
Allow SVG usage in WordPress
<?php
// Allow SVG usage in WordPress
function bloggerpilot_cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'bloggerpilot_cc_mime_types');
@coder618
coder618 / Gutenberg Sample Block form carbon field
Created June 18, 2020 07:08
Gutenberg Sample Block form carbon field wordpress plugin
<?php
use Carbon_Fields\Container;
use Carbon_Fields\Field;
use Carbon_Fields\Block;
add_action( 'carbon_fields_register_fields', 'dd' );
function dd(){
// var_dump( WP_Block_Type_Registry::get_instance()->get_all_registered() );
Block::make( __( 'My Shiny Gutenberg Block' ) )
  • SC1000 $ is not used specially and should therefore be escaped.
  • SC1001 This \o will be a regular 'o' in this context.
  • SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
  • SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
  • SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
  • SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
  • SC1009 The mentioned parser error was in ...
  • SC1010 Use semicolo
@thomasmaurer
thomasmaurer / settings.json
Last active August 16, 2025 10:14
My Windows Terminal Settings settings.json February 2021
// This file was initially generated by Windows Terminal 1.3.2651.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@KittenCodes
KittenCodes / single-event.php
Last active October 15, 2021 18:00
The Events Calendar - Single Event
<?php
$events_label_singular = tribe_get_event_label_singular();
$events_label_plural = tribe_get_event_label_plural();
$event_id = get_the_ID();
?>
<div id="tribe-events-content" class="tribe-events-single">
Добавить в начале строки Найти ^ Заменить 0;
^\W пробел в начале строки
\d{8} найти 8 цыфр подряд
^\d{4};92 найти В НАЧАЛЕ ЧЕТЫРЕХзначные числа после которы есть ;92
[^=]*$ любые символы, кроме "="
;(.*) все после ;
(\b\S+\b)(?=.*\1) повторение на строке
\d [0-9] Цифровой символ
@joshschmelzle
joshschmelzle / remove-gamebar-powershell-win10.md
Last active January 2, 2026 22:27
How to Remove the Xbox Game Bar with Powershell on Windows 10. Scroll to the end of the gist for Windows 11.

You've probably stumbled upon this researching how to remove the Xbox Game Bar. This gist includes a few different methods you can try. Please note that some of these first options are probably not be available unless you are running an older version of Windows 10.

EDIT: make sure to check out the comment below from @nmhung1985 which seems to be working for most folks.

Uninstalling/Removing the Game Bar (old Windows 10 build GUI options)

(this is no longer an option on any recent Windows 10 build)

  1. Press Windows Key or click on the Start menu.
  2. Start typing Xbox or Game Bar, until you get the Xbox Game Bar app to appear in the results.
@mlocati
mlocati / exceptions-tree.php
Created March 9, 2017 10:58
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@NickSeagull
NickSeagull / ubuntu-bloat-removal.sh
Last active January 23, 2026 15:50
Updated Jan 22nd, 2024 - Simple command to remove all "bloatware" from ubuntu
sudo apt-get remove \
aisleriot \
brltty \
duplicity \
empathy \
empathy-common \
example-content \
gnome-accessibility-themes \
gnome-contacts \
gnome-mahjongg \
@chranderson
chranderson / nvmCommands.js
Last active February 17, 2026 14:55
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node