Skip to content

Instantly share code, notes, and snippets.

@darookee
darookee / show-event-details-on-cart.php
Last active July 4, 2023 08:47 — forked from andrasguseo/show-event-details-on-cart.php
Show event title and date on WooCommerce cart page
<?php
add_filter( 'woocommerce_cart_item_name', 'krbu_event_title', 10, 3 );
function krbu_event_title($title, $values, $cart_item_key) {
$ticket_meta = get_post_meta($values['product_id']);
$event_id = absint($ticket_meta['_tribe_wooticket_for_event'][0]);
$venue_id = tribe_get_venue_id($event_id);
if ($event_id) {
@darookee
darookee / git.rb
Created February 10, 2014 10:28 — forked from alx/git.rb
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
-- SPLIT_STR MySQL Function
-- from http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
CREATE FUNCTION SPLIT_STR(
x VARCHAR(255),
delim VARCHAR(12),
pos INT
)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
<?php return array (
'db' =>
array (
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'port' => '3306',
'dbname' => 'shopware',
),
'mail' => array(
(function(d, script) {
var js,
fjs = d.getElementsByTagName(script)[0];
function load(url, id) {
if(d.getElementById(id)) {return;}
js = d.createElement(script);
js.async = true;
js.src = url;
@darookee
darookee / gist:4032285
Created November 7, 2012 15:35 — forked from boriskaiser/gist:3908158
Easy retina-ready images using SCSS + Compass
@mixin background-2x($background, $file: 'png'){
$image: #{$background+"."+$file};
$image2x: #{$background+"@2x."+$file};
background: url($image) no-repeat;
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx){