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
git config core.filemode false |
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 concat(fks.constraint_schema, '.', fks.table_name) as foreign_table, | |
'->' as rel, | |
concat(fks.unique_constraint_schema, '.', fks.referenced_table_name) | |
as primary_table, | |
fks.constraint_name, | |
group_concat(kcu.column_name | |
order by position_in_unique_constraint separator ', ') | |
as fk_columns | |
from information_schema.referential_constraints fks | |
join information_schema.key_column_usage kcu |
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
// order array diachritic | |
$collator = new Collator('fr_FR'); | |
$collator->asort($results); |
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://sqlfordevs.com/for-each-loop-lateral-join | |
SELECT customers.*, recent_sales.* | |
FROM customers | |
LEFT JOIN LATERAL ( | |
SELECT * | |
FROM sales | |
WHERE sales.customer_id = customers.customer_id | |
ORDER BY created_at DESC | |
LIMIT 3 |
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
kill -9 $(lsof -ti:4321) | |
lsof -i tcp:8080 | |
kil PID | |
# wmysql PID | |
ps -ef | grep mysql |
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
* * * * * cd /var/www/dev/cashier && php artisan schedule:run >> /dev/null 2>&1 |
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
sudo mkdir /mnt/music | |
sudo mount -t drvfs '\\192.168.68.2\music' /mnt/music |
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://sqlfordevs.io/delete-duplicate-rows | |
WITH duplicates AS ( | |
SELECT id, ROW_NUMBER() OVER( | |
PARTITION BY firstname, lastname, email | |
ORDER BY age DESC | |
) AS rownum | |
FROM contacts | |
) | |
DELETE contacts |
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
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
$arguments = "& '" + $myinvocation.mycommand.definition + "'" | |
Start-Process powershell -Verb runAs -ArgumentList $arguments | |
Break | |
} | |
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" | |
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
if ($found) { |
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
cd /var/www/.git chown -R mike:mike objects |