Skip to content

Instantly share code, notes, and snippets.

@topfuel75
topfuel75 / jquery.selecttext.js
Created July 10, 2023 23:45 — forked from sinky/jquery.selecttext.js
jQuery Select Text
// Source: http://stackoverflow.com/a/987376/1461859 (http://jsfiddle.net/edelman/KcX6A/1506/)
jQuery.fn.selectText = function(){
var doc = document
, element = this[0]
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(element);
@topfuel75
topfuel75 / simpleDirectoryLister.php
Created June 6, 2023 23:43 — forked from simkoG/simpleDirectoryLister.php
A simple PHP Directory Lister
<?php
/*
*** OPTIONS ***/
// TITLE OF PAGE
$title = "List of Files";
// ADD SPECIFIC FILES YOU WANT TO IGNORE HERE
$ignore_file_list = array( ".htaccess", "Thumbs.db", ".DS_Store", "index.php" );
@topfuel75
topfuel75 / detect-unused-css-selectors.js
Created December 26, 2022 11:29 — forked from victor-homyakov/detect-unused-css-selectors.js
Detect unused CSS selectors. Show possible CSS duplicates. Monitor realtime CSS usage.
/* eslint-disable no-var,no-console */
// detect unused CSS selectors
(function() {
var parsedRules = parseCssRules();
console.log('Parsed CSS rules:', parsedRules);
detectDuplicateSelectors(parsedRules);
var selectorsToTrack = getSelectorsToTrack(parsedRules);
window.selectorStats = { unused: [], added: [], removed: [] };
console.log('Tracking style usage (inspect window.selectorStats for details)...');
@topfuel75
topfuel75 / .htaccess
Last active April 12, 2022 08:04 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
Redirects for .htaccess
============================
# Place this in a sub-folder
# If requested resource is not an existing file or directory, redirect to ../
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . / [L,R=302]