Skip to content

Instantly share code, notes, and snippets.

View Skullbock's full-sized avatar

Daniele Rosario Skullbock

View GitHub Profile
@Skullbock
Skullbock / uploadable.php
Created December 22, 2011 15:14
Nooku Controller Uploadable Behavior
<?php
/**
* @copyright Copyright (C) 2011 Weble
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.weble.it
*/
/**
* Controller Uploadable Behavior
*
@Skullbock
Skullbock / locatable.php
Created December 22, 2011 15:21
Nooku Database Locatable Behavior (Radius Search)
<?php
/**
* @package Parking
* @copyright Copyright (C) 2011 Weble
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.weble.it
*/
/**
* Database Locatable Behaviour
@Skullbock
Skullbock / gist:3009650
Created June 28, 2012 07:19
Javascript: jQuery Plugin
(function($){
var Plugin = function(){};
$.extend(Plugin.prototype, {
name: 'REPLACE_NAME',
initialize: function(element, options){
var $this = this;
<?php
// load zoo
require_once(JPATH_ADMINISTRATOR.'/components/com_zoo/config.php');
$zoo = App::getInstance('zoo');
// New Item? alternatively you load using $zoo->table->item->load($id);
$item = new Item();
foreach ($item->getElements() as $element ) {
$element->bindData($data);
}
@Skullbock
Skullbock / config.php
Created November 12, 2019 14:35
YooTheme Pro - Custom Configuration for Google Tag Manager (GTM)
<?php
return [
// Unique module name, replace with your child theme name
'name' => 'yootheme/{child_theme}',
// Bootstrap code, executed when module is loaded
'main' => function () {
// Executed when child theme is active
@Skullbock
Skullbock / query.sql
Last active April 28, 2020 07:01
ManyToMany Views query performance
SELECT tmp.*, base_component_price + components_price) as product_price
FROM(
SELECT
products.*,
base_components.*,
SUM(components.price) as components_price,
base_components.price as base_component_price,
FROM products
LEFT JOIN base_components ON products.base_component_code = components.code
LEFT JOIN products_components ON products.code = products_components.product_code
@Skullbock
Skullbock / AddToCart.php
Last active May 26, 2020 10:21
Livewire emits Laravel events
<?php
namespace App\Http\Livewire;
use App\Http\Livewire\Concern\EmitsLaravelEvents;
use Livewire\Component;
use Weble\LaravelEcommerce\Cart\CartManager;
use Weble\LaravelEcommerce\Cart\Event\CartItemAdded;
class AddToCart extends Component
@Skullbock
Skullbock / machine.js
Last active September 18, 2020 16:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Skullbock
Skullbock / content.php
Created May 7, 2021 09:11
ZOOlanders Essentials for YOOthemePro - Current Date Form Element
<input type="text" value="<?php date('Y-m-d') ?>" placeholder="<?php date('Y-m-d') ?>"/>
@Skullbock
Skullbock / install-chrome-ubuntu.md
Last active December 12, 2024 14:51
Install Google Chrome on Ubuntu

Install Google Chrome on Ubuntu

  1. Get the signing key of the chrome repo curl -fSsL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor | sudo tee /usr/share/keyrings/google-chrome.gpg > /dev/null

  2. Add the repo to the list of repos echo deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main | sudo tee /etc/apt/sources.list.d/google-chrome.list

  3. Update repo list sudo apt-get update