This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Dribbler Tarbaby Community v.0.1.0 - Copyright 2013-2014 under GNU/GPL | |
// Original script by Mike (zaphod@spambotsecurity.com) | |
// http://www.stopforumspam.com/forum/viewtopic.php?pid=41173 | |
// | |
// Contributors: | |
// John Darkhorse | |
// Derek Haupin (dhaupin@gmail.com) | |
// | |
// @@ WARNING @@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @@TODO@@ classify this as a pub pre-controller | |
// @@TODO@@ semicolin var, might help edge \xYZ style hexors -- might affect speed though | |
// @@TOTO@@ make vars to turn on blocking of common WP and enterprise requests | |
// @@TODO@@ make modes to check in user agent, referrer, post, headers | |
// @@TODO@@ mode for strict validation of IP in addr + forwarder style headers | |
// @@TODO@@ testing mode (still allows traffic) | |
// @@TODO@@ log wrapper and modes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is part of a product class, this function shalt also be available via route with optional ?search= param | |
// $this->request->get is platform specific, change it to whatever your request wrapper uses | |
public function googlecats($cat_ids = false) { | |
// default format | |
$json = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<NotepadPlus> | |
<UserLang name="Smarty-DH" ext="tpl" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00{* 01 02*} 03 04*</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://documentation.cpanel.net/display/SDK/Guide+to+Standardized+Hooks+-+The+manage_hooks+Utility | |
# To add a script to upcp schema (as a hook) | |
/usr/local/cpanel/bin/manage_hooks add script /root/src/cpanel-hooks/postupcp.sh --manual --category System --event upcp --stage post | |
# To remove a script as hook from upcp schema | |
/usr/local/cpanel/bin/manage_hooks delete script /root/src/cpanel-hooks/postupcp.sh --manual --category System --event upcp --stage post | |
# To list current hooks ( | |
/usr/local/cpanel/bin/manage_hooks list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shortcode - Render Wordpress login form | |
**/ | |
add_shortcode('wp_login_form', function() { | |
if (is_user_logged_in()) { | |
} else { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Rewrite client IP based on proxy headers | |
$ip_pool = array( | |
!empty($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : '', | |
!empty($_SERVER['HTTP_CF_PSEUDO_IPV4']) ? $_SERVER['HTTP_CF_PSEUDO_IPV4'] : '', | |
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '', | |
!empty($_SERVER['HTTP_X_FORWARDED']) ? $_SERVER['HTTP_X_FORWARDED'] : '', | |
!empty($_SERVER['HTTP_FORWARDED_FOR']) ? $_SERVER['HTTP_FORWARDED_FOR'] : '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* UI Breakpoint Listener | |
* Requires underscore/lodash for _debounce | |
*/ | |
body:after { | |
content: 'widescreen'; | |
display: none; | |
} | |
@media screen and (max-width: 1024px){ | |
body:after { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Idea from: https://github.com/zenseo/opencart-needless-image | |
# PHP is not good enough to run this through a large store with many images | |
# Bash cp cant hold enough arguments from file output unless its batched | |
# Rclone is the best bet: | |
# rsync -asv --dry-run --recursive --remove-source-files --checksum --files-from=some-file.txt . destination/ | |
function findImages() { | |
$tables_to_check = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backup-oc() { | |
accnt=account | |
prefix=prefix | |
path=subfolder (no pre or trailing slash) | |
if [ ! -d "/backup/_SYNC/${accnt}" ]; then | |
mkdir -p /backup/_SYNC/${accnt} | |
fi | |
if [ ! -d "/home/${accnt}/_SYNC" ]; then |
NewerOlder