Skip to content

Instantly share code, notes, and snippets.

View puleeno's full-sized avatar
:octocat:
I'm creating something

Puleeno Nguyen puleeno

:octocat:
I'm creating something
View GitHub Profile
@puleeno
puleeno / gist:e5c975ea2185eb2fddd0a42101b724bf
Last active June 30, 2024 16:32
Gutenberg investigate

core-block-supports

#0 wp_add_inline_style() called at [wp-includes/script-loader.php:3166] 
#1 wp_enqueue_stored_styles() called at [wp-includes/class-wp-hook.php:324
@puleeno
puleeno / uclean.php
Last active May 7, 2024 06:04
PHP Command line to clean files in current working directory
#!/usr/bin/env php
<?php
class Uclean {
protected $binPath;
protected Uclean_Arguments $args;
protected $pwd;
protected $fileSize;
protected $negativeFileSize;
@puleeno
puleeno / sublime_text_3_folder_context.reg
Created December 29, 2023 05:02
Sublime Text context menu for folder on Windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text]
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe"
[HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text\command]
@="C:\\Program Files\\Sublime Text 3\\sublime_text.exe \"%1\""
@puleeno
puleeno / ts2mp4.php
Last active May 7, 2023 14:35
Convert .ts to .mp4 using ffmpeg
#!/usr/bin/env php
<?php
class Ts2Mp4_Break {
}
class Ts2Mp4_Args {
private $shortOptions = [
'ext',
'e',
@puleeno
puleeno / asset-helpers.php
Created May 28, 2022 04:05
WordPress helper check JS, CSS is registered correctly
<?php
function puleeno_check_registered_assets($script_name, $is_style = true) {
global $wp_scripts, $wp_styles;
$repository = $is_style ? $wp_styles : $wp_scripts;
$assets = $repository->registered;
if (!isset($assets[$script_name])) {
return false;
}
@puleeno
puleeno / php.rb
Last active January 10, 2021 05:45
PHP 8.0.1 Embed for MACOS
class Php < Formula
desc "General-purpose scripting language"
homepage "https://www.php.net/"
# Should only be updated if the new version is announced on the homepage, https://www.php.net/
url "https://www.php.net/distributions/php-8.0.1.tar.xz"
mirror "https://fossies.org/linux/www/php-8.0.1.tar.xz"
sha256 "208b3330af881b44a6a8c6858d569c72db78dab97810332978cc65206b0ec2dc"
license "PHP-3.01"
version "8.0.1-embed"
@puleeno
puleeno / woocommerce-cart-and-total.php
Last active October 18, 2020 04:01
WooCommerce - Show number of items in cart and total
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>">
<?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?>
<?php echo WC()->cart->get_cart_total(); ?>
</a>
@puleeno
puleeno / Browser History API.md
Created October 8, 2020 04:02
Change URL and cleart history URL

Run this block where you want change route

history.entries = []; history.index = -1; history.push(/route);

This will clear the history and change for a new one.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@puleeno
puleeno / Thunder.md
Last active November 27, 2020 04:13
Chinese Vietnamese
分机启动迅雷 Khởi động Thunder
启动时默认屐示精选页面 Hiển thị trang nổi bật theo mặc định khi khởi động
启动后自动升始未完成任务 Các công việc chưa hoàn thành sau khi tự động khởi động
同时下载的最大任务数、5 {1-20} Số tác vụ tối đa được tải xuống cùng lúc, 5 {1-20}
创建任务后显示下载界面 Hiển thị giao d