Skip to content

Instantly share code, notes, and snippets.

View amudala14's full-sized avatar
🎯
Focusing

Museme Amudala amudala14

🎯
Focusing
View GitHub Profile
@amudala14
amudala14 / countryPhoneCodes.json
Created April 5, 2023 12:23 — forked from pickletoni/countryPhoneCodes.json
JSON array of 248 countries with phone codes and ISO country code
[{"country":"Afghanistan","code":"93","iso":"AF"},
{"country":"Albania","code":"355","iso":"AL"},
{"country":"Algeria","code":"213","iso":"DZ"},
{"country":"American Samoa","code":"1-684","iso":"AS"},
{"country":"Andorra","code":"376","iso":"AD"},
{"country":"Angola","code":"244","iso":"AO"},
{"country":"Anguilla","code":"1-264","iso":"AI"},
{"country":"Antarctica","code":"672","iso":"AQ"},
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"},
{"country":"Argentina","code":"54","iso":"AR"},
@theRemix
theRemix / bcrypt-example.js
Last active February 16, 2020 21:02
bcrypt example
const bcrypt = require('bcrypt');
const saltRounds = 10;
const myPlaintextPassword = 'a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_a_really_long_passphrase_';
console.log('password length', myPlaintextPassword.length)
// auto generate salt and hash
bcrypt.hash(myPlaintextPassword, saltRounds, (err, hash) => {
// Store hash in your password DB.
console.log('bcrypt salted hash:', hash)
@kloon
kloon / functions.php
Last active March 4, 2024 19:36
WooCommerce total order weight column on orders page
<?php
add_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' );
function woo_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 );
function woo_custom_order_weight_column( $column ) {
global $post, $woocommerce, $the_order;