Skip to content

Instantly share code, notes, and snippets.

View MikeiLL's full-sized avatar

Mike iLL Kilmer MikeiLL

View GitHub Profile
@jameskoster
jameskoster / functions.php
Created June 6, 2013 09:24
Change breadcrumb separator in WooThemes WooCommerce themes.
add_filter( 'woo_breadcrumbs_args', 'jk_custom_breadcrumbs_args', 10 );
function jk_custom_breadcrumbs_args ( $args ) {
$args = array( 'separator' => '<' );
return $args;
}
@msng
msng / strpos_array.php
Last active June 28, 2022 20:15
PHP: strpos_array is strpos that can take an array as needle
<?php
function strpos_array($haystack, $needles, $offset = 0) {
if (is_array($needles)) {
foreach ($needles as $needle) {
$pos = strpos_array($haystack, $needle);
if ($pos !== false) {
return $pos;
}
}
return false;
@ChuckMac
ChuckMac / WordPress Plugin Activation Dependency Check
Created January 25, 2013 17:51
WordPress plugin depency check. Check if another plugin is installed before allowing yours to be installed
/**
* Activation Class
**/
if ( ! class_exists( 'WC_CPInstallCheck' ) ) {
class WC_CPInstallCheck {
static function install() {
/**
* Check if WooCommerce & Cubepoints are active
**/
if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ||
@psobot
psobot / bufferedreadqueue.py
Created November 9, 2012 18:05
Buffered Read Queue for Multiprocessing in Python
import Queue
import multiprocessing
import threading
class BufferedReadQueue(Queue.Queue):
def __init__(self, lim=None):
self.raw = multiprocessing.Queue(lim)
self.__listener = threading.Thread(target=self.listen)
self.__listener.setDaemon(True)
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
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

…………………………

@kovshenin
kovshenin / plugin.php
Created October 26, 2012 07:55
Settings API Demo
<?php
/**
* Plugin Name: My Plugin
* Plugin Description: Settings API Demo
*/
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_options_page( 'My Plugin', 'My Plugin', 'manage_options', 'my-plugin', 'my_options_page' );
}
@BFTrick
BFTrick / deploy.sh
Created September 22, 2012 18:28
WordPress Plugin Deploy Script
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config
@offsky
offsky / NewMacConfig.md
Last active July 3, 2017 15:50
Setup new mac for web development (Updated for Yosemite)
@psobot
psobot / yaml_file.py
Created August 8, 2012 20:28
Real-time YAML object access in Python
"""
liveyamlfile.py
Live Pythonic attribute access to properties in a yaml file.
by Peter Sobot (hi@psobot.com), August 8, 2012
"""
import os
import time
import yaml
import logging
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>