Skip to content

Instantly share code, notes, and snippets.

View mch0lic's full-sized avatar

Mindaugas Budreika mch0lic

View GitHub Profile
<?php
/**
* Plugin Name: WooCommerce Payment Gateway - TF Bank
* Description: TF Bank Credit Line integration.
* Version: 1.0.1
* Author: Mindaugas Budreika
* Author URI: mailto:mindaugas.budreika@thecoffeemate.group
* Text Domain: woocommerce-gateway-tf-bank
* WC requires at least: 3.5.3
* WC tested up to: 3.5.3
<?php
/**
* Category and product tag og:image fix for SEO by yoast / woocommerce
*/
function fabframe_print_custom_og_image()
{
if ( is_product_category() ) {
global $post;
if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
File path = new File(Environment.getExternalStorageDirectory()
+ File.separator + context.getString(R.string.app_dir));
if(!path.exists()) {
path.mkdirs();
}
}
@mch0lic
mch0lic / gist:11232368
Created April 23, 2014 21:05
nimble_portfolio_register_taxonomies patch
function nimble_portfolio_register_taxonomies() {
register_taxonomy('nimble-portfolio-type', 'portfolio', array('hierarchical' => true, 'label' => 'Item Type', 'query_var' => true, 'rewrite' => array('slug' => 'portfolio-type')));
if (count(get_terms('nimble-portfolio-type', 'hide_empty=0')) == 0) {
register_taxonomy('type', 'portfolio', array('hierarchical' => true, 'label' => 'Item Type'));
$_categories = get_categories('taxonomy=type&title_li=');
foreach ($_categories as $_cat) {
if (!term_exists($_cat->name, 'nimble-portfolio-type'))
wp_insert_term($_cat->name, 'nimble-portfolio-type');
}
Validation file:
X\YBundle\Entity\ContactsUpload:
properties:
name:
- NotBlank: ~
file:
- File:
maxSize: 1024k
mimeTypes: 'application/vnd.oasis.opendocument.spreadsheet'
mimeTypesMessage: Please upload valid spreadsheet file!