Skip to content

Instantly share code, notes, and snippets.

@full-stack-king
full-stack-king / .zshrc
Created February 28, 2020 04:16
My ZSH settings
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@full-stack-king
full-stack-king / Woocommerce_remove_product_meta_action.php
Last active December 26, 2019 16:11
Remove or Hide product meta (SKU, categories and tags) from WooCommerce single product pages
/* Add this code at the bottom of your theme's function.php or in your plugin code */
/* Remove product meta */
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@full-stack-king
full-stack-king / returnException.php
Last active February 28, 2020 04:59
Return authentication exception for Laravel API 5.6
<?php
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
@full-stack-king
full-stack-king / WordPress-Utility.php
Created July 12, 2019 04:29
Most used wordpress custom codes
<?php
//////////////////////
// Custom Post Type //
//////////////////////
/*
* Creating a function to create our CPT tours
*/

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@full-stack-king
full-stack-king / react-note.md
Last active November 8, 2022 05:44
React / React Native apk build release build and cache clear

Clear bundle cache before release build

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

Get a release build

cd android && ./gradlew assembleRelease && ../
[
{
"action": "talk",
"voiceName": "Russell",
"text": "Hi Darling.Learn javascript as soon as possible.Love you. Bye"
}
]
@full-stack-king
full-stack-king / linux-apache-file-dir-permission.sh
Created October 31, 2016 12:25
Linux apache file and directory permission
groups
sudo groupadd www
sudo usermod -a -G www ec2-user
sudo usermod -a -G www apache
sudo chown -R root:www castle_invoice/
find ./castle_invoice -type d -exec sudo chmod 2775 {} \;
find ./castle_invoice -type f -exec sudo chmod 0664 {} \;
sudo service httpd restart
@full-stack-king
full-stack-king / ubuntu-php-version-switch.md
Last active November 15, 2019 04:10
How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04? / How to change php version in Ubuntu Apache

Switch PHP version:

Note: change PHP version numbers to match your requirement. I have used 5.6 and 7.0

From php5.6 to php7.0 :

Apache:

Changing php version for Aapche server

sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
@full-stack-king
full-stack-king / woocommerce-failed-order-email-notification.php
Created March 14, 2016 07:48
WooCommerce failed order email notification
<?php
/**
* Add a failed order email notification
*/
function sp_failed_order_email_notification( $order_id ) {
$order = wc_get_order( $order_id );
$to = get_option( 'admin_email' );
$subject = 'A order failed, action required';