Skip to content

Instantly share code, notes, and snippets.

@amboutwe
amboutwe / yoast_seo_canonical_change_woocom_shop.php
Last active March 6, 2025 17:20
Code snippets for the Yoast SEO canonical output
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );
@jj1bdx
jj1bdx / quic-restrictions.md
Last active February 16, 2024 09:34
Do not enable QUIC on 1280-byte MTU IPv6 networks

Do not enable QUIC on 1280-byte MTU IPv6 networks

Synopsis

  • QUIC requires transmission of at least 1350 bytes of UDP packets on IPv6 (and 1370 bytes on IPv4).
  • On Chrome/Chromium (and Vivaldi), if sending 1350-byte UDP packet fails on IPv6, fallback to HTTP/2 over TCP immediately occurs.

Implementation details on Chrome/Chromium (60.0.3112.55 on Vivaldi)

See the explanation in Japanese for the further details on the current implementation. Note well that this differs from the latest version of QUIC Internet-Draft: see draft-ietf-quic-transport-01 Section 8. Quote:

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 17, 2025 12:50 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@maxost
maxost / AndroidUtils.kt
Created September 5, 2017 02:09
Kotlin: make phone call in Android
fun Context.makePhoneCall(number: String) : Boolean {
try {
val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$number"))
startActivity(intent)
return true
} catch (e: Exception) {
e.printStackTrace()
return false
}
}
@Pulimet
Pulimet / AdbCommands
Last active July 17, 2025 10:19
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@iturgeon
iturgeon / gist:b558ca84907e7dfc42ff42e57a3aff73
Last active March 2, 2025 05:12
Taboola blocking hosts file domains
# Block Taboola ads
127.0.0.1 popup.taboola.com
127.0.0.1 www.popup.taboola.com
127.0.0.1 taboola.com
127.0.0.1 www.taboola.com
127.0.0.1 cdn.taboolasyndication.com
127.0.0.1 taboolasyndication.com
127.0.0.1 www.taboolasyndication.com
127.0.0.1 www.cdn.taboolasyndication.com
127.0.0.1 trc.taboola.com
@chenxiaolong
chenxiaolong / DellXPS15_9560_AHCI_RAID.md
Created November 27, 2017 01:33
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@dardo82
dardo82 / safari-favicons.sh
Last active February 16, 2024 02:40
Fix Safari FavIcons
#!/bin/zsh
# Fix Safari Favorites Icons
CS="cache_settings"; TIC="Touch Icons Cache"; DIR="$HOME/Library/Safari/$TIC/Images"
DB="$DIR/../${${TIC// }%%s*}${${(C)CS}//_}.db"; SQL=$(sqlite3 "$DB" "SELECT host FROM $CS")
sqlite3 "$DB" "UPDATE $CS SET ${${${(L)TIC// /_}#*_}//s/_is_in}=1, download_status_flags=1"
for png in "$1"/*.png; do URL="$(plutil -convert xml1 -o - "$DIR/../../Bookmarks.plist" | \
awk -F '[</>]' -v name="${${png##*/}%%.*}" '$3~name{getline;getline;getline;print $5}')"; \
cp -f -v "$png" "$DIR/${(U)$(md5 -q -s $URL)}.png"; done; chflags -v uappnd $DIR $DB*
@0rka
0rka / .smali
Created January 28, 2018 11:36
smali example
.class public Lcom/test/helloworld/HelloWorldActivity;
.super Landroid/app/Activity;
.source "HelloWorldActivity.java"
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"
.prologue
@xujiaao
xujiaao / android-set-ntp-server.md
Last active May 4, 2025 12:55
Set the NTP server of your android device
tags
Android
Android Things

Set the NTP server of your android device