Skip to content

Instantly share code, notes, and snippets.

View jimboobrien's full-sized avatar

Jimobrien jimboobrien

View GitHub Profile
@DamianZaremba
DamianZaremba / cPanel Hook output
Created November 3, 2010 10:37
cPanel hook output
ADD DNS
Cpanel::Config::LoadCpUserFile::load('system') called at /usr/local/cpanel/Cpanel/Config/LoadCpUserFile.pm line 158
Cpanel::Config::LoadCpUserFile::loadcpuserfile('system') called at /usr/local/cpanel/Cpanel/Config/ModCpUserFile.pm line 26
Cpanel::Config::ModCpUserFile::adddomaintouser('user', 'system', 'domain', 'test.damian.internal', 'type', '') called at /usr/local/cpanel/Cpanel/DnsUtils.pm line 446
Cpanel::DnsUtils::doadddns('domain', 'test.damian.internal', 'ip', '127.0.0.1', 'reseller', 'root', 'trueowner', 'system') called at whostmgr/bin/whostmgr line 3197
main::adddns() called at whostmgr/bin/whostmgr line 669
EDIT OPEN
main::getzonelocal() called at whostmgr/bin/dnsadmin-ssl line 339
@pklaus
pklaus / mb2md-3.20.pl
Created May 9, 2011 09:07
Converting Mbox mailboxes to Maildir format. See <http://batleth.sapienti-sat.org/projects/mb2md/>
#!/usr/bin/perl -w
#
# $Id: mb2md.pl,v 1.26 2004/03/28 00:09:46 juri Exp $
#
# mb2md-3.20.pl Converts Mbox mailboxes to Maildir format.
#
# Public domain.
#
# Republished by Philipp Klaus.
# Referred to by <http://blog.philippklaus.de/2010/02/convert-mbox-to-maildir/>
@daltonrooney
daltonrooney / file-upload-handler.php
Created February 4, 2012 13:29
Multi-file WordPress uploads from the front-end
<?php /* This function attaches the image to the post in the database, add it to functions.php */
function insert_attachment($file_handler,$post_id,$setthumb='false') {
// check to make sure its a successful upload
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
@Rarst
Rarst / r-debug.php
Last active March 27, 2025 16:58
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
*/
@woogist
woogist / gist:5541418
Created May 8, 2013 15:54
WooCommerce - Change Placeholder Image
/*
* goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :)
*
**/
add_action( 'init', 'custom_fix_thumbnail' );
function custom_fix_thumbnail() {
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src');
function custom_woocommerce_placeholder_img_src( $src ) {
@strangerstudios
strangerstudios / gist:5573829
Last active January 10, 2025 12:48
Paid Memberships Pro customization to only let members of a certain level checkout if a discount code was used.
/*
Only let level 1 members sign up if they use a discount code.
Place this code in your active theme's functions.php or a custom plugin.
*/
function my_pmpro_registration_checks_require_code_to_register($pmpro_continue_registration)
{
//only bother if things are okay so far
if(!$pmpro_continue_registration)
return $pmpro_continue_registration;
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active March 20, 2025 17:17
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@inear
inear / gist:7616849
Last active December 29, 2015 04:39
#!/bin/bash
# uses imagemagick to stich together all images in a folder.
# ex command: ./spriter.sh rivendell-title jpg 640 400
if [ $# -gt 3 ]
then
folder=$1;
name=$1; # output will be placed in a folder named this
@alexis-gruet-deel
alexis-gruet-deel / gist:9243496
Created February 27, 2014 02:56
Round Robin Algorithm PHP
/**
for( $a=1; $a<20; $a++ ) {
echo '----------------------' . PHP_EOL;
echo 'PROJECT_ID :: ' . $a . PHP_EOL;
$last = $c[ 'predis' ]->get( 'round-robin-dispatch' );
$i = $j = -1;
$n = count( $array );
@parzonka
parzonka / install-gradle-centos.sh
Last active July 4, 2024 05:28
Install gradle on redhat/centos linux
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.9
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
. /etc/profile.d/gradle.sh