Skip to content

Instantly share code, notes, and snippets.

@dtbaker
dtbaker / create-quote.php
Last active June 2, 2018 20:23
Create a quote in UCM from a remote url
<?php
chdir('/path/to/ucm/folder/on/webhost/');
include('init.php'); // the UCM init code.
// login as admin
module_security::user_id_temp_set(1);
$customer_data = array(
'customer_name' => 'Name Here',
@dtbaker
dtbaker / run_bot.php
Created May 28, 2016 12:29
Run this PHP script and it will start a "bot" user on Slack that does Google Searches for you
<?php
require 'vendor/autoload.php';
use PhpSlackBot\Bot;
// Custom command
class MyCommand extends \PhpSlackBot\Command\BaseCommand {
protected function configure() {
$this->setName('bot');
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@Asbra
Asbra / craigslist.php
Created December 13, 2014 16:27
PHP Craigslist job finder (scraper)
<?php
/**
* Craigslist job finder
* Scans a given Craigslist section, checks titles for keyword(s), then emails when found.
* @author Johan <[email protected]>
* @date 2014-11-10
* @modified 2014-11-10
*/
// the $keyword variable contains the keywords you want to find
// $keyword = 'programmer';
@renventura
renventura / remove-category-wc-category-widget.php
Last active May 25, 2020 15:12
Removes an array of product categories from the WooCommerce Product Category Widget.
<?php // Mind this opening php tag
/**
* Remove Categories from WooCommerce Product Category Widget
*
* @author Ren Ventura
*/
//* Used when the widget is displayed as a dropdown
add_filter( 'woocommerce_product_categories_widget_dropdown_args', 'rv_exclude_wc_widget_categories' );
@mustafaturan
mustafaturan / latest-ffmpeg-centos6.sh
Last active October 25, 2022 20:14
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0