Skip to content

Instantly share code, notes, and snippets.

@Karting06
Karting06 / detect-js-framework.js
Created March 13, 2024 20:38 — forked from rambabusaravanan/detect-js-framework.js
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@Karting06
Karting06 / breadcrumb-cache.theme
Created August 15, 2021 12:24 — forked from Aeotrin/breadcrumb-cache.theme
Drupal 8 - Breadcrumb Preprocess and Cache
function theme_preprocess_breadcrumb(&$variables) {
if (($node = \Drupal::routeMatch()->getParameter('node')) && $variables['breadcrumb']) {
$variables['breadcrumb'][] = [
'text' => $node->getTitle()
];
$variables['#cache']['contexts'][] = 'url.path';
}
}
@Karting06
Karting06 / gist:cff3468a10e4171b0123d7a5eb4a6bd9
Created February 13, 2017 11:12
Prevent DPI scaling in Outlook Signatures images
This is for HTML signatures (tested in Outlook 2010/2016)
You have to specify the size of the image in <img> tag.
For example, a image of width 30px and height 30px:
<img src="<url>" alt="text" width="30" height="30">
@Karting06
Karting06 / gist:622b377da213d2551124baeacce75d7b
Created July 30, 2016 13:23 — forked from allella/gist:ffdcf0a5dd9e147405b5
Let's Encrypt .htaccess to Fix Issues with Drupal or Wordpress Getting "cannot connect" Error
# add this before all other rewrite rules in your .htaccess
# backup your Apache file(s) first to avoid breaking things
# BE SURE TO TEST AND RELOAD APACHE AFTER MAKING THIS EDIT
# allow Let's Encrypt to access it's challenge file without the rewrite rules screwing them up
RewriteEngine On
RewriteRule "^.well-known/acme-challenge" - [L]
# Now, run an error check and reload Apache
/usr/sbin/apachectl configtest && /etc/init.d/httpd reload