This file contains hidden or 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
USE INFORMATION_SCHEMA; | |
SELECT | |
TABLES.table_name | |
FROM TABLES | |
LEFT JOIN KEY_COLUMN_USAGE AS c | |
ON ( | |
TABLES.TABLE_NAME = c.TABLE_NAME | |
AND c.CONSTRAINT_SCHEMA = TABLES.TABLE_SCHEMA | |
AND c.constraint_name = 'PRIMARY' | |
) |
This file contains hidden or 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
ALTER USER `root`@`%` IDENTIFIED WITH mysql_native_password BY [PASSWORD] |
This file contains hidden or 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
const str = DATE_STRING | |
const isoDate = /(Sun\w*\.?|Mon\w*\.?|Tue\w*\.?|Wed\w*\.?|Thu\w*\.?|Fri\w*\.?|Sat\w*\.?)?\ ?(Jan\w*\.?|Feb\w*\.?|Mar\w*\.?|Apr\w*\.?|May\w*\.?|Jun\w*\.?|Jul\w*\.?|Aug\w*\.?|Sep\w*\.?|Oct\w*\.?|Nov\w*\.?|Dec\w*\.?)\ ?(\d+)?,? \ ?(\d{1,2}:\d{1,2}:?\d{2}?\ ?\w{3}\ ?)?(\d{4})/.exec(str) |
This file contains hidden or 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
<?php | |
define('FORCE_SSL_ADMIN', true); | |
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) { | |
$_SERVER['HTTPS'] = 'on'; | |
} |
This file contains hidden or 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
#!/usr/bin/env bash | |
sudo nginx -t && sudo systemctl reload nginx |
This file contains hidden or 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
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name selfagency.net; | |
# SSL | |
ssl_certificate /etc/letsencrypt/live/selfagency.net/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/selfagency.net/privkey.pem; | |
ssl_trusted_certificate /etc/letsencrypt/live/selfagency.net/chain.pem; |
This file contains hidden or 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
#!/usr/bin/env bash | |
$DOMAIN=selfagency.dev | |
[email protected] | |
sudo sed -i -r 's/(listen .*443)/\1;#/g; s/(ssl_(certificate|certificate_key|trusted_certificate) )/#;#\1/g' /etc/nginx/sites-available/$DOMAIN.conf | |
sudo certbot certonly --webroot -d $DOMAIN --email $EMAIL -w /var/www/_letsencrypt -n --agree-tos --force-renewal | |
sudo sed -i -r 's/#?;#//g' /etc/nginx/sites-available/$DOMAIN.conf | |
sudo nginx -t && sudo systemctl reload nginx |
This file contains hidden or 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
<iframe src="signal.svg" onload="this.before(this.contentDocument.children[0]); this.remove();"></iframe> |
This file contains hidden or 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 (require.main === module) { | |
console.log('called directly'); | |
} else { | |
console.log('required as a module'); | |
} |
This file contains hidden or 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
<script> | |
(function(a,b,c){var d=a.history,e=document,f=navigator||{},g=localStorage, | |
h=encodeURIComponent,i=d.pushState,k=function(){return Math.random().toString(36)}, | |
l=function(){return g.cid||(g.cid=k()),g.cid},m=function(r){var s=[];for(var t in r) | |
r.hasOwnProperty(t)&&void 0!==r[t]&&s.push(h(t)+"="+h(r[t]));return s.join("&")}, | |
n=function(r,s,t,u,v,w,x){var z="https://www.google-analytics.com/collect", | |
A=m({v:"1",ds:"web",aip:c.anonymizeIp?1:void 0,tid:b,cid:l(),t:r||"pageview", | |
sd:c.colorDepth&&screen.colorDepth?screen.colorDepth+"-bits":void 0,dr:e.referrer|| | |
void 0,dt:e.title,dl:e.location.origin+e.location.pathname+e.location.search,ul:c.language? | |
(f.language||"").toLowerCase():void 0,de:c.characterSet?e.characterSet:void 0, |