Skip to content

Instantly share code, notes, and snippets.

Avatar
🍐
❹❷

David Vielhuber vielhuber

🍐
❹❷
View GitHub Profile
@vielhuber
vielhuber / index.html
Last active Apr 29, 2021
seo mega menu submenu linkjuice hide dropdown links prevent crawl #seo #js
View index.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" />
<title>.</title>
<script>
function restoreHiddenLinks() {
let links = document.querySelectorAll('a[data-hide-crawl]');
if( links.length > 0 ) {
@vielhuber
vielhuber / README.MD
Last active May 10, 2021
sell and remote update free pro release premium plugins #wordpress
View README.MD

preparation

server

plugin

@vielhuber
vielhuber / index.html
Last active May 12, 2021
add icon to all external links (based on target) #js
View index.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" />
<title>.</title>
<style>
.container {
width: 50%;
margin: 0 auto;
@vielhuber
vielhuber / index.php
Last active Apr 14, 2021
blacklist comment form block list check mail spam #php
View index.php
function checkBlacklist($message) {
if (!is_string($message) || trim($message) == '') {
return true;
}
$filename = sys_get_temp_dir() . '/spam-blacklist.txt';
if( !file_exists($filename) || filemtime($filename) < strtotime('now - 1 month') ) {
$content = @file_get_contents('https://raw.githubusercontent.com/splorp/wordpress-comment-blacklist/master/blacklist.txt');
if( $content != '' ) {
file_put_contents($filename, $content);
}
@vielhuber
vielhuber / robots.txt
Created Apr 8, 2021
modified optimized robots.txt #wordpress #seo
View robots.txt
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /readme.html
Disallow: /refer/
Sitemap: https://www.tld.com/sitemap_index.xml
@vielhuber
vielhuber / index.html
Last active Mar 25, 2021
slideup slidedown pure css or advanced js solution #js #css
View index.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" />
<title>.</title>
<script>
document.addEventListener('DOMContentLoaded', () => {
if( document.querySelector('.toggle--1') !== null ) {
document.querySelectorAll('.toggle--1').forEach(el => {
@vielhuber
vielhuber / query.sql
Created Mar 17, 2021
simulate slow insert query in sqlite #sql
View query.sql
WITH RECURSIVE r(i) AS (
VALUES(0)
UNION ALL
SELECT i FROM r
LIMIT 10000000
)
INSERT INTO test (col1, col2, col3) VALUES ((SELECT i FROM r ORDER BY i LIMIT 1), (SELECT i FROM r ORDER BY i LIMIT 1), (SELECT i FROM r ORDER BY i LIMIT 1));
@vielhuber
vielhuber / 0.md
Last active Apr 21, 2021
combine pngs to apng animated png #tools
View 0.md
  • 1.md: convert fla (animate cc) to pngs
  • 2.md: install apngasm
  • 3.md: convert pngs to apng
  • 4.md: reverse filenames
@vielhuber
vielhuber / index.php
Created Mar 3, 2021
google custom search #php
View index.php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
echo '
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" />
<title>.</title>
@vielhuber
vielhuber / index.html
Last active Mar 3, 2021
simple styled tooltip title #js
View index.html
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, minimum-scale=1" />
<title>.</title>
<script>
document.addEventListener('DOMContentLoaded', () => {
if (document.querySelector('.tooltip') !== null) {
document.querySelectorAll('.tooltip').forEach((el) => {