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 | |
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 | |
} |
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
//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 |
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
############################################ | |
## 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 |
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
documentroot "c:/xampp/htdocs/magento" | |
servername magento.server.dev | |
SetEnv MAGE_IS_DEVELOPER_MODE "1" |
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 | |
/** | |
* @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 |
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
import Image | |
import os | |
files = [f for f in os.listdir('.') if os.path.isfile(f)] | |
for file in files: | |
if file.endswith(('.jpg')): | |
img = Image.open(os.path.join(os.curdir, file)) | |
size = img.size | |
if ((410, 300) != size): | |
name = file + ' ' |
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
CREATE DEFINER=`[USER_NAME]`@`%` TRIGGER `[DATABASE_NAME]`.`Slug` BEFORE INSERT ON `[TABLE_NAME]`.`games` FOR EACH ROW | |
BEGIN | |
IF NEW.slug IS NULL THEN | |
SET NEW.slug = LOWER(TRIM(NEW.name)); | |
SET NEW.slug = REPLACE(NEW.slug, ':', ''); | |
SET NEW.slug = REPLACE(NEW.slug, ')', ''); | |
SET NEW.slug = REPLACE(NEW.slug, '(', ''); | |
SET NEW.slug = REPLACE(NEW.slug, ',', ''); | |
SET NEW.slug = REPLACE(NEW.slug, '\\', ''); | |
SET NEW.slug = REPLACE(NEW.slug, '?', ''); |
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
import os | |
import csv | |
with open('old-names-new-names.csv', 'rb') as csvfile: | |
csvreader = csv.reader(csvfile, delimiter=',', quotechar='"') | |
for row in csvreader: | |
name = row[0] + '.jpg' | |
new = row[1] + '.jpg' | |
if os.path.exists(name): | |
os.rename(name, new) |
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
/** | |
* Created by simonfacciol on 13/02/16. | |
*/ | |
var gulp = require('gulp'), | |
fs = require('fs'), | |
del = require('del'), | |
plugins = require('gulp-load-plugins')({ | |
pattern: ['gulp-*', 'gulp.*'], | |
replaceString: /\bgulp[\-.]/, | |
lazy: 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
#!/bin/bash | |
# Author:Andrey Nikishaev | |
# Modified: Simon Facciol | |
echo "CHANGELOG" | |
echo ---------------------- | |
git for-each-ref --sort=-taggerdate --format '%(tag)-%(*authordate)' refs/tags | grep 'release' | while read RES ; do | |
IFS='-' read -a arrRES <<< "${RES}" | |
TAG=${arrRES[0]} | |
DAT=${arrRES[1]} | |
echo |
OlderNewer