Skip to content

Instantly share code, notes, and snippets.

@thefuxia
thefuxia / t5-page-feed.php
Created May 22, 2012 00:47
Newsfeed for post type 'page'
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Page Feed
* Description: Adds a feed for pages at <code>/feed/?post_type=page</code>.
* Version: 2012.05.22
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
@Gen2ly
Gen2ly / md2wp
Created July 9, 2012 23:34
Convert Markdown to Wordpress blogging format
#!/bin/bash
# Convert Markdown to Wordpress blogging format
# Required program(s)
req_progs=(ascii2uni pandoc)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@staaldraad
staaldraad / huaweiDecrypt.py
Created March 11, 2015 13:19
Decrypt Huawei router/firewall passwords. Huawei stores passwords using DES encryption when the crypted option is enabled.
#!/usr/bin/python
"""
Simple tool to extract local users and passwords from most Huawei routers/firewalls config files.
Will extract plain-text passwords and crypted credentials. Huawei config files use DES encryption with
a known key. Using this information, the script will decrypt credentials found in the config file.
Author: Etienne Stalmans (etienne@sensepost.com)
Version: 1.0 (12/01/2014)
"""
from Crypto.Cipher import DES
@caiotarifa
caiotarifa / wpcf7_send_to_mailchimp.php
Last active February 11, 2023 17:44
CONTACT FORM 7 -> MAILCHIMP 3.0
<?php
// -------------------------------------------------------------------------- //
// CONTACT FORM 7 -> MAILCHIMP //
// -------------------------------------------------------------------------- //
// © 2015 Caio Tarifa. All Rights Reserved. //
// -------------------------------------------------------------------------- //
function wpcf7_send_to_mailchimp() {
@thorsten
thorsten / setUserAgent.js
Created May 9, 2016 15:12
Override user agent on all browsers
function setUserAgent(window, userAgent) {
// Works on Firefox, Chrome, Opera and IE9+
if (navigator.__defineGetter__) {
navigator.__defineGetter__('userAgent', function () {
return userAgent;
});
} else if (Object.defineProperty) {
Object.defineProperty(navigator, 'userAgent', {
get: function () {
return userAgent;
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active December 25, 2025 05:52
Detect new network devices connecting to OpenWrt and send text message
@damiencarbery
damiencarbery / download-link-to-audio-player.php
Last active April 12, 2022 13:02
Append a Download link to the WordPress audio shortcode output
@vdbelt
vdbelt / cloudflare-purge-cache-service-worker.js
Created August 21, 2018 11:43
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@damiencarbery
damiencarbery / wc-attribute-name-and-value.php
Last active October 9, 2024 00:28
Display attribute name and value in WooCommerce -Show the attribute name beside the attribute value in WooCommerce (in Cart, Checkout and order emails). https://www.damiencarbery.com/2019/09/display-attribute-name-and-value-in-woocommerce/
<?php
/*
Plugin Name: Display attribute name and value in WooCommerce
Plugin URI: https://www.damiencarbery.com/2019/09/display-attribute-name-and-value-in-woocommerce/
Description: Show the attribute name beside the attribute value in WooCommerce (in Cart, Checkout and order emails).
Author: Damien Carbery
Version: 0.2
*/
add_filter( 'woocommerce_product_variation_title_include_attributes', 'dcwd_product_variation_title_include_attributes', 10, 2 );
@danieldogeanu
danieldogeanu / WampHTTPS.md
Last active August 13, 2026 12:24
How to enable HTTPS for WAMP Server.

After you've downloaded and installed WAMP Server, follow these steps:

  1. Generate SSL certificate using OpenSSL:
  • Add C:\wamp64\bin\apache\apache2.4.27\bin directory to the PATH so you can access openssl command from the command prompt (WAMP comes with its own version of OpenSSL already integrated, so you don't need to install it. You'll find it in this directory.).

    IMPORTANT: Please note that the path of your installation depends on your version of Apache! DO NOT copy and paste the paths presented in this gist as they will not match with yours!

  • Navigate to your user directory (C:\Users\%YOUR_USERNAME%\), create a new folder (.openssl), navigate to it with Powershell and run these commands:

    openssl genrsa -aes256 -out private.key 2048
    

openssl rsa -in private.key -out private.key