Skip to content

Instantly share code, notes, and snippets.

View cfoellmann's full-sized avatar
🐶
Dogging on

Christian Foellmann cfoellmann

🐶
Dogging on
  • W&S Technik GmbH
  • Castrop-Rauxel, NRW, Germany
View GitHub Profile
@johnalarcon
johnalarcon / functions.php
Last active January 7, 2019 01:33
Prevent username enumeration via WordPress / ClassicPress REST API.
/**
* Prevent username enumeration via REST API
*
* This function allows normal (anonymous) access to the REST API, but makes
* sure that site usernames are not exposed through it. This code can be added
* to your theme's functions.php file.
*
* Note: there has been a report that this code may interfere with JetPack's operation.
* See https://twitter.com/PrysmcatBooks/status/1082022370817261568
*/
@semenko
semenko / SetupFoldersForOneDrive.ps1
Last active December 20, 2023 01:07
Powershell Redirect Folders to OneDrive Account & Sync
# Work in progress!
# Derived from http://stackoverflow.com/questions/25709398/set-location-of-special-folders-with-powershell
<#
.SYNOPSIS
Sets a known folder's path using SHSetKnownFolderPath.
.PARAMETER Folder
The known folder whose path to set.
.PARAMETER Path
The path.
@iMazed
iMazed / spamreferrals.txt
Last active May 6, 2022 19:08
Spam referral list to add to Google Analytics spam filters. Custom filter > Exlude > Campaign Source.
share-buttons.xyz
traffic2cash.xyz
с.новым.годом.рф
net-profits.xyz
social-widget.xyz
free-social-buttons.xyz
4webmasters.org
76brighton.co.uk
7makemoneyonline.com
acads.net
@mathetos
mathetos / plugin.php
Last active April 13, 2023 16:48
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
@wpchannel
wpchannel / mu-yoast-seo-disable-notifications.php
Last active April 16, 2023 08:33
Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices
<?php if (!defined('ABSPATH')) die('Restricted Area');
/*
* Plugin Name: Disable Yoast SEO Notifications
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices.
* Version: 1.1
* Author: Aurélien Denis
* Author URI: https://wpchannel.com/
*/
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@ChaseWiseman
ChaseWiseman / convert-post-meta.php
Last active December 27, 2015 09:50
A function for converting existing WordPress meta keys to new values.
/**
* Convert existing meta keys to new meta keys.
*
* @since x.x.x
*
* @global object $wpdb The current database.
*
* @param string $existing_key The existing meta key.
* @param string $new_key The new meta key.
* @param bool $remove_existing Optional. Whether to remove the old meta entries after conversion.
@seenmyfate
seenmyfate / Capfile
Created April 23, 2014 07:55
Capistrano v3 custom Submodule Strategy example
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/scm'
require 'capistrano/git'
class Capistrano::Git < Capistrano::SCM
module SubmoduleStrategy
include DefaultStrategy
def release
@mauryaratan
mauryaratan / css_resources.md
Created April 17, 2014 15:43 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides