This file contains hidden or 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 | |
| // add product to cart with additional data | |
| $woocommerce->cart->add_to_cart($post->ID, $quantity = 1, $variation_id = '', $variation = $entry[1], $cart_item_data = array( | |
| 'hire_price'=>123, | |
| )); | |
| // make sure additional data sticks in the session |
This file contains hidden or 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 | |
| /* | |
| Plugin Name: Ajaxtest | |
| Plugin URI: http://enru.co.uk/ | |
| Description: spits out page/post slug on autosave/edit | |
| Version: 0.1 | |
| Author: Neill Russell (@enru) | |
| Author URI: http://enru.co.uk/ | |
| */ |
This file contains hidden or 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
| select * from wp_term_taxonomy tt | |
| left join wp_terms t on tt.term_id = t.term_id | |
| where tt.taxonomy = 'product_cat' and tt.parent = 0; |
This file contains hidden or 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 | |
| /* | |
| * Created on Sep 28, 2009 | |
| * @author Neill Russell <n@enru.co.uk> | |
| */ | |
| if($argc < 2) die(sprintf("Usage: %s <MAGENTO_ROOT>\n", $_SERVER['SCRIPT_FILENAME'])); | |
| define('MAGENTO_DIR', realpath($argv[1])); |
This file contains hidden or 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
| INSERT INTO `eav_attribute` (`entity_type_id`, | |
| `attribute_code`, | |
| `attribute_model`, | |
| `backend_model`, | |
| `backend_type`, | |
| `backend_table`, | |
| `frontend_model`, | |
| `frontend_input`, | |
| `frontend_input_renderer`, | |
| `frontend_label`, |
This file contains hidden or 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
| <project name="PhoneGapCopy" default="init" basedir="."> | |
| <description> | |
| sets up phonegap in a new android app | |
| usage: ant -f phonegapcopy.xml -DPHONEGAP_HOME=/home/enru/phonegap-9f0856d | |
| </description> | |
| <property name="PHONEGAP_HOME" value=""/> | |
| <target name="init"> | |
| <copy todir="./libs/"> | |
| <fileset dir="${PHONEGAP_HOME}/Android/"> | |
| <include name="phonegap-*.jar"/> |
This file contains hidden or 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 | |
| c=0; for i in *.JPG; do mv "$i" "`printf %05d $c`.jpg"; c=$((c+1));done | |
| ffmpeg -r 6 -b 2000 -i %05d.jpg -vcodec libx264 -vpre hq -vpre ipod640 -an -threads 0 -b 5000k video.mp4 |
This file contains hidden or 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 | |
| /* | |
| Plugin Name: redirect/routes test | |
| Plugin URI: http://blog.enru.co.uk/2011-11-04-wordpress-plugin-with-own-url.html | |
| Description: An example of how to give a WordPress plugin it's own URL/route | |
| Version: 0.1 | |
| Author: Neill Russell | |
| Author URI: http://www.enru.co.uk | |
| License: Beerware | |
| */ |
This file contains hidden or 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
| set expandtab | |
| set nocompatible | |
| set autoindent | |
| set smartindent | |
| set tabstop=4 | |
| set shiftwidth=4 | |
| set showmatch | |
| set guioptions-=T | |
| set vb t_vb= | |
| set ruler |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # inspired by this post: | |
| # http://www.bluebox.net/news/2009/07/mysql_encoding | |
| import MySQLdb | |
| DB_NAME="example" | |
| DB_USER="root" | |
| DB_HOST="locahost" |