Skip to content

Instantly share code, notes, and snippets.

@simofacc
simofacc / post-to-curl.php
Last active February 6, 2016 16:23
Wordpress - Send post data to 3rd party service via curl
<?php
/**
* @package Post-to-Curl
* @version 1.0
*/
/*
Plugin Name: Post-to-Curl
Plugin URI: http://www.simonfacciol.info
Description: Send post data / status to 3rd party service via curl
Author: Simon Facciol
@simofacc
simofacc / httpd.conf
Created January 31, 2016 08:50
Setting environment variables in Magento using httpd.conf
documentroot "c:/xampp/htdocs/magento"
servername magento.server.dev
SetEnv MAGE_IS_DEVELOPER_MODE "1"
@simofacc
simofacc / .htaccess
Created January 31, 2016 08:48
Setting environment variables in Magento using .htaccess
############################################
## If developing on localhost, uncomment this to enable developer mode
SetEnvIf REMOTE_ADDR ^127.0.0.1 MAGE_IS_DEVELOPER_MODE
# Default store
SetEnvIf HOST ^store1.yourdomain.com.au$ MAGE_RUN_CODE=default
SetEnvIf HOST ^store1.yourdomain.com.au$ MAGE_RUN_TYPE=store
# Store two variables
SetEnvIf HOST ^store2.yourdomain.com.au$ MAGE_RUN_CODE=store_two
@simofacc
simofacc / youtube-hide.js
Last active October 25, 2017 07:49
How to stop a youtube iframe video after closing a popup
//Cache jQuery object in a variable
var $youtubeIframeId = $('#YourIFrameID');
//First get the iframe URL
var url = $youtubeIframeId.attr('src');
//Then assign the src to an empty String, this then stops the video from playing
$youtubeIframeId.attr('src', '');
// Finally reassign the iframe URL (url) back to the iframe, so when you hide the video and show it again you still have the correct source
@simofacc
simofacc / drupal7.php
Last active January 31, 2016 08:42
Drupal 7 – Enable a theme from a custom module via code
<?php
function mymodule_init()
{
$themes = list_themes(); //Get all the available themes
if ($themes['mythemename']->status == 0) {
//if mythemename status is 0 i.e. disabled
theme_enable(array(
'mythemename'
)); //enable theme
}