Skip to content

Instantly share code, notes, and snippets.

View kipBO's full-sized avatar

kip kipBO

View GitHub Profile
@kipBO
kipBO / checkurl.js
Created September 25, 2025 16:31
Check URL via virustotal node.js
const express = require('express')
const app = express()
const port = 3000
app.get('/', async (req, res) => {
const responseUrl = await fetch("https://www.virustotal.com/api/v3/urls", {
method: "POST",
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
@kipBO
kipBO / post-to-discord.php
Created July 12, 2024 14:26
WordPress published and pending posts webhook to discord
<?php
/*
* Plugin Name: Webhook to Discord
* Description: WordPress posts to Discord.
* Version: 1.0
* Author: Kip @ codump.github.io
*/
function post_to_discord($new_status, $old_status, $post) {
if(get_option('discord_webhook_url') == null)
@kipBO
kipBO / version-push.js
Created February 11, 2023 15:13
Version push to cache in JavaScript
let pushVersion = "1.0.1d"
let baseUrl = window.location.href
Array.from(document.getElementsByTagName("link")).forEach((childLink) => {
const newHref = childLink.href.replaceAll('?v=pushVersion', `?v=${pushVersion}`)
childLink.setAttribute('href', newHref)
})
const addScript = document.createElement("script")
addScript.setAttribute("src", `${baseUrl}/script.js?v=${pushVersion}`)
addScript.setAttribute("type", "text/javascript")
@kipBO
kipBO / draft-import.php
Created February 7, 2023 15:57
Woocommerce CSV import products as draft
<?php
/*
Plugin Name: Import as draft
Description: CSV imported products are set to draft instead of published
Version: 1.0
Author: Kip @ codump.github.io
*/
add_filter( 'woocommerce_product_import_pre_insert_product_object', 'process_import', 10, 2 );
function process_import( $product, $data ) {
@kipBO
kipBO / clickAllCloseMenu.js
Last active December 2, 2022 21:50
A snippet to close a menu or so when clicked anywhere
$('html').click(function (e) {
var offTarget = $(".offTarget"); // you can add this class to button and menu so it stays clickable //
if (!offTarget.is(e.target) && offTarget.has(e.target).length === 0) {
if($('#menu').is(':visible')){
$('#closeTrigger').trigger('click'); // simulate click on close button //
}
}
});
@kipBO
kipBO / clickAllCloseMenu.js
Created December 2, 2022 21:17
A snippet to close a menu or so when clicked anywhere
$('html').click(function (e) {
var offTarget = $(".offTarget"); // you can add this class to button and menu so it stays clickable //
if (!offTarget.is(e.target) && offTarget.has(e.target).length === 0) {
if($('#menu').is(':visible')){
$('#closeTrigger').trigger('click'); // simulate click on close button //
}
}
});
@kipBO
kipBO / index.html
Created January 28, 2018 21:35
basis index update1
<head>
<title>Voorbeeld titel.</title>
<meta charset="UTF-8"><!-- charset is de karakter instellingen van de pagina, zie W3 voor meer info. -->
<meta name="description" content="Omschrijving van je pagina, deze wordt door bijvoorbeeld facebook opgehaald en getoond." />
<meta name="keywords" content="sleutelwoorden, gescheiden, door, een, komma" />
<meta name="author" content="jouw naam" />
<link rel="stylesheet" href="style.css" />
<script>
alert('Welkom');
</script>
@kipBO
kipBO / style.css
Created January 28, 2018 21:30
basis .css
body {
background:#000;
color:#FFF;
}
#waarde1 {
color:red;
}
.waarde2 {
color:blue;
}
@kipBO
kipBO / index.html
Last active January 28, 2018 21:05
Basis .html
<!DOCTYPE html>
<html>
<head>
<title>Voorbeeld titel.</title>
<meta charset="UTF-8"><!-- charset is de karakter instellingen van de pagina, zie W3 voor meer info. -->
<meta name="description" content="Omschrijving van je pagina, deze wordt door bijvoorbeeld facebook opgehaald en getoond." />
<meta name="keywords" content="sleutelwoorden, gescheiden, door, een, komma" />
<meta name="author" content="jouw naam" />
<style>
body {