Skip to content

Instantly share code, notes, and snippets.

View soderlind's full-sized avatar

Per Søderlind soderlind

View GitHub Profile
@Rarst
Rarst / r-debug.php
Last active February 3, 2024 17:30
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@malarkey
malarkey / Contract Killer 3.md
Last active May 17, 2024 15:28
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@Coopeh
Coopeh / get_domain_mapped_url.php
Created December 18, 2012 19:25
Get Domain Mapped URL From BlogID
<?php
// Function to get a blog/site's domain mapped url.
//
// You need to call it with a blog ID
//
// Example:
// $custom_blog_id = '14';
// echo get_domain_mapped_url( $custom_blog_id );
//
<?php
/*
* Since PHP5 there is no need to pass an reference of $this
*
* @see http://php.net/manual/en/language.oop5.references.php
* [...] As of PHP 5, an object variable doesn't contain the object itself as value anymore [...]
*/
add_action( 'load-upload.php', array( $this, 'custom_bulk_action' ) );
@brasofilo
brasofilo / wp-admin-pointers.php
Last active September 3, 2023 20:25
WordPress Admin Pointers : based on code by Stephen Harris, Tim D and Frank Bueltge. See: http://stackoverflow.com/a/19328125/1287812 and http://brasofilo.com/como-incluir-admin-pointers-en-tu-theme-o-plugin
<?php
/**
* Plugin Name: My Amdin Pointers
* Plugin URI: https://gist.github.com/brasofilo/6947539
* Version: 0.1
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com
* Licence: GPLv3
*
@jeremyjaymes
jeremyjaymes / filetype-extension.php
Last active May 22, 2024 17:27
WordPress Get Attachment File Type Extension
<?php
/**
* Get attachment file type extension
*
* Requires that you have the attachment id
* See this post http://jeremyjaymes.com/display-attach…ordpress-theme/ for more explanation
*/
//* Assumes we're in a loop and have our attachment id already
$file_url = wp_get_attachment_url( $file_id );
@jaydansand
jaydansand / wp_allow_update_notifications.php
Last active January 3, 2022 17:45
WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
<?php
/*
Plugin Name: Allow Update Notifications
Plugin URI: https://gist.github.com/jaydansand/2e41490a8b040a199db4
Description: WordPress plugin to allow module/theme/core update notifications even when DISALLOW_FILE_MODS is TRUE.
Version: 1.0
Author: Jay Dansand, Technology Services, Lawrence University
Author URI: https://gist.github.com/jaydansand
*/
/* Copyright 2014 Lawrence University
@lumpysimon
lumpysimon / gist:5a68f561fd2381e64efe
Last active March 8, 2016 17:06
Example WordPress custom post type and taxonomy definitions using Extended CPTs and Extended Taxos
register_extended_post_type(
'newsletter',
array(
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 45,
'quick_edit' => false,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'admin_cols' => array(
'newsletter-image' => array(
@SGudbrandsson
SGudbrandsson / index.php
Last active June 10, 2023 01:11
Create a WordPress staging area from your live wordpress setup with a Click-of-a-button [TM] ..
<?php
/**
*
* This script will copy your wordpress from public_html (or wherever)
* and place it in a staging folder.
* It will then clone the database, reconfigure the config file
* and replace URL's from the original URL to your staging URL.
* It will then make sure to NOT allow search engines to index the page.
*
* Use this script to clone your main wp in order to test maintenance work
@neilgee
neilgee / custom-provision.sh
Created July 13, 2015 02:58
Custom VVV Variable Provisioning for WordPress sites
# #!/bin/bash
# #
# # provision.sh
# #
# # This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# # provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# # or `vagrant reload` are used. It provides all of the default packages and
# # configurations included with Varying Vagrant Vagrants.
# # By storing the date now, we can calculate the duration of provisioning at the