Skip to content

Instantly share code, notes, and snippets.

Piotr piotr-cz

Block or report user

Report or block piotr-cz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@piotr-cz
piotr-cz / CustomSelect2Adapter.js
Last active Jun 25, 2019
Select2 ArrayAdapter to keep options in order they were selected
View CustomSelect2Adapter.js
// Tested on Select2 v4.0.2
// Init
var $select = jQuery('#my-select');
var select2Options = {
multiple: true
};
// Add decorator adapter
if (keepOptionsOrder) {
@piotr-cz
piotr-cz / deploy.json
Last active May 3, 2018
Gulp - FTP deploy updated files
View deploy.json
{
"env": {
"staging": {
"ftpConfig": {
"host": "xxx",
"user": "xxx",
"pass": "xxx"
},
"path": {
"local": "./public",
@piotr-cz
piotr-cz / helper.php
Last active Jan 2, 2016
Joomla-CMS: JInstallerHelper::downloadPackage patch to encode url query values
View helper.php
/**
* JInstallerHelper::downloadPackage patch to encode redirect url query values.
*
* File Locations:
* - J3.2: /libraries/cms/installer/helper.php
* - J2.5: /libraries/joomla/installer/helper.php
*
* For performance reasons (assuming that initial $url is valid),
* this code can be moved just under the `302 == $response->code` check.
*/
@piotr-cz
piotr-cz / gist:6635698
Created Sep 20, 2013
Test usage of [com_ajax](https://github.com/joomla/joomla-cms/pull/1960). Please note I don't know how the jQuery response looks like, this is based on guess.
View gist:6635698
$.ajax({
type : 'POST',
data : request,
// Got HTTP response code 200
success: function (response)
{
switch (this.data.request.format)
{
// Handling JSON format
@piotr-cz
piotr-cz / JHtmlEmail
Last active Dec 19, 2015
Updated JHtmlEmail. Changes: - optimized javascript code - when javascript is disabled, message is now shown in <noscript /> tag - fixed bug in XHTML documents - added placeholder character to show when javascript is disabled
View JHtmlEmail
<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
View gist:4603186
/**
* Removes the admin menu item for a given component
*
* This method was pilfered from JInstallerComponent::_removeAdminMenus()
* /libraries/joomla/installer/adapters/component.php : _removeAdminMenus
*
* @param int $id The component's #__extensions id
*
* @return bool True on success, false on failure
*
@piotr-cz
piotr-cz / Backbone-fw_agnostic.js
Created Dec 7, 2011
Backbone.js Framework agnostic
View Backbone-fw_agnostic.js
// Backbone.js 0.5.3
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://documentcloud.github.com/backbone
(function(){
// Initial Setup
// -------------
You can’t perform that action at this time.