This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delete table in MySQL from theri prefix. | |
*/ | |
DECLARE @prefix VARCHAR(255) = 'mytableprefix' | |
SET GROUP_CONCAT_MAX_LEN=10000; | |
SET @tbls = (SELECT GROUP_CONCAT(TABLE_NAME) | |
FROM information_schema.TABLES | |
WHERE TABLE_SCHEMA = 'my_database' | |
AND TABLE_NAME LIKE @prefix + '_%'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ABILITARE I COLORI | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
#GESTIONE PS1 | |
#export PS1="\[\e[01;31m\]\u\[\e[0m\]\[\e[01;31m\]:\[\e[1;33m\]\W\[\e[m\] \\$ " | |
export PS1="\[\033[38;5;39m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;1m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[48;5;39m\][\w]\[$(tput sgr0)\]\[\033[48;5;15m\] \[$(tput sgr0)\]\[\033[38;5;39m\] >_: \[$(tput sgr0)\]" | |
#export PS1="\[\e[01;31m\]\u\[\e[0m\]\[\e[01;31m\]# \[\e[0m\]\[\e[\033[48;5;39m\]\w\[\e[0m\]\[\e[01;33m\]:\[\e[0m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
-- Order Meta | |
p.ID AS order_id, | |
p.post_status AS order_status, | |
p.post_date AS order_date, | |
max( CASE WHEN pm.meta_key = '_order_total' AND p.ID = pm.post_id THEN pm.meta_value END ) AS order_total, | |
max( CASE WHEN pm.meta_key = '_order_tax' AND p.ID = pm.post_id THEN pm.meta_value END ) AS order_tax, | |
-- Payment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string xml = '<Profile><First_Name><![CDATA[Luke]]</First_Name><Last_Name><![CDATA[Skywalker]]</Last_Name><guid><![CDATA[D521C0A3-B6BB-4EA0-AEC6-07860BFE9313]]></guid></Profile>'; | |
string json = string.Empty; | |
if (!string.IsNullOrEmpty(response_xml)) | |
{ | |
var doc = XElement.Parse(response_xml); | |
var node_cdata = doc.DescendantNodes().OfType<XCData>().ToList(); | |
foreach (var node in node_cdata) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
***UPDATED: modified as bootstrap 4 classes | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.mr-10 which gives margin-right 10 pixels. | |
.mr-15 gives MARGIN to the RIGHT 15 pixels. | |
.mt-15 gives MARGIN to the TOP 15 pixels and so on. | |
.pb-5 gives PADDING to the BOTTOM of 5 pixels | |
.pl-40 gives PADDING to the LEFT of 40 pixels | |
The first letter is "m" or "p" for MARGIN or PADDING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/dotnet-outdated/dotnet-outdated | |
# This is a continuation of the original dotnet-outdated tool created by Jerrie Pelser. | |
# If you already have the original dotnet-outdated tool installed you need to | |
# run dotnet tool uninstall --global dotnet-outdated before installing this version. | |
# View dotnet tool installed | |
alias tool:l='dotnet tool list --global' | |
# Install tool by this command and pass a name of tool es. <dotnet-outdated-tool> | |
# # tool:i <tool-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resource: | |
- Victor Mono [https://rubjo.github.io/victor-mono/] | |
- Fira Code [https://github.com/tonsky/FiraCode] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate a random color in HEX format | |
* @param {number} opacity The opacity value between 0 and 1. If null use 1 as default value | |
* @param {number} whiteDistance distance from the white color. If null use 600 as default value | |
* @returns {string} the color in HEX format | |
* */ | |
const generateRandomHexColor = (opacity, whiteDistance) => { | |
let r, g, b; | |
opacity ??= 1; | |
whiteDistance ??= 600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert value to the money. | |
* @param {any} s string with the value | |
* @param {number} ndd NumberDecimalDigits | |
* @returns | |
*/ | |
const toMoney = (s, ndd) => { | |
let cookieUser = GetLoggedUserInfo(); | |
let cookieCulture; | |
let culture; |