Skip to content

Instantly share code, notes, and snippets.

View danihuge's full-sized avatar

Dani Garcia danihuge

View GitHub Profile
@danihuge
danihuge / bookmarklet_gmail_refresh_accounts.js
Created January 14, 2025 18:40
This bookmarklet automates navigating to Gmail's "Accounts and Import" settings and clicks the "Check mail now" links for all linked accounts. Useful for quickly syncing mail from external accounts directly within Gmail.
javascript:(function() {
if (!location.href.includes("https://mail.google.com")) {
alert("Primero abre Gmail en esta pestaña o en otra pestaña.");
return;
}
setTimeout(() => {
const navigateToSettings = () => {
const settingsButton = document.querySelector('div[data-tooltip="Settings"]');
if (settingsButton) {
@danihuge
danihuge / wp-disable-plugin-update.php
Created April 21, 2022 10:25 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
@danihuge
danihuge / mysql-docker.sh
Created January 3, 2022 10:58 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@danihuge
danihuge / load_dotenv.sh
Created December 23, 2021 17:24 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@danihuge
danihuge / gist:d298739a969c77cd7c2695f372a2dd94
Created November 6, 2021 18:34 — forked from bubenkoff/gist:96e04fb219ff9edcd4f62b43b44a5c94
Force elastic beanstalk cron job to run
aws sqs send-message --queue-url=<queue url> --message-body='elasticbeanstalk scheduled job' --message-attributes '{"beanstalk.sqsd.path": {"DataType": "String", "StringValue": "<task url>"}, "beanstalk.sqsd.scheduled_time": {"DataType": "String", "StringValue": "2001-02-03T00:00:00+00:00"}}'
@danihuge
danihuge / openssl_cert_expiring_date.txt
Created September 14, 2021 14:08
CLI command to check SSL cert expiring date
echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -enddate
@danihuge
danihuge / curl_ssl_cert.txt
Last active September 14, 2021 14:04
CLI script to check SSL cert
curl --insecure -vvI https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }'