Skip to content

Instantly share code, notes, and snippets.

@alex7r
alex7r / config.json
Created June 13, 2016 19:05 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@alex7r
alex7r / list.php
Created July 1, 2016 13:24
pagination limitation of MySQL Calc found rows
<?php /**
* Method to get the starting number of items for the data set.
*
* @return integer The starting number of items available in the data set.
*
* @since 12.2
*/
public function getStart()
{
$store = $this->getStoreId('getstart');
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@alex7r
alex7r / snippet.php
Created August 5, 2016 11:02
Change protected property
<?php
$reflectionAppClass = new ReflectionClass($this->app);
$reflectionAppClassProperty = $reflectionAppClass->getProperty('template');
$reflectionAppClassProperty->setAccessible(true);
$reflectionAppClassProperty->setValue($this->app, $template);
@alex7r
alex7r / composer.sync.php
Last active November 8, 2016 17:18
sketch for composer syncer
<?php
define('JPATH_BASE', __DIR__);
define('EXTRACT_DIRECTORY', JPATH_BASE.DIRECTORY_SEPARATOR.'tmp/composer');
use Composer\Json\JsonFile;
if(!(file_exists(JPATH_BASE.'/libraries/composer.lock') && file_exists(JPATH_BASE.'/libraries/composer.phar') && file_exists(JPATH_BASE.'/libraries/composer.json'))){
die("Seems like composer at joomla isn't initiated, so no need to sync.");
}
if (file_exists(EXTRACT_DIRECTORY.'/vendor/autoload.php') !== true) {
@alex7r
alex7r / 20-xdebug.ini
Last active April 4, 2019 09:06
Setup Xdebug
[Xdebug]
zend_extension="/usr/lib/php/20151012/xdebug.so"
xdebug.idekey="PHPSTORM"
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_connect_back = on
xdebug.remote_host = 10.0.2.2
xdebug.renite_enable = 1
xdebug.max_nesting_level = 1000
xdebug.remote_port = 9000
@alex7r
alex7r / recovernight.reg
Created August 25, 2017 14:21
Recover night mode Windows 10
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.bluelightreduction.bluelightreductionstate]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.bluelightreduction.bluelightreductionstate\Current]
"Data"=hex:02,00,00,00,54,83,08,4a,03,ba,d2,01,00,00,00,00,43,42,01,00,10,00,d0,0a,02,c6,14,b8,8e,9d,d0,b4,c0,ae,e9,01,00
@alex7r
alex7r / rabbitmq.txt
Created October 14, 2017 11:37 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@alex7r
alex7r / _ide_helper.php
Created December 19, 2017 08:05
Joomla IDE helper for migration from <3.8
<?php
class JRegistry extends \Joomla\Registry\Registry {}
class JRegistryFormat extends \Joomla\Registry\AbstractRegistryFormat {}
class JRegistryFormatIni extends \Joomla\Registry\Format\Ini {}
class JRegistryFormatJson extends \Joomla\Registry\Format\Json {}
class JRegistryFormatPhp extends \Joomla\Registry\Format\Php {}
class JRegistryFormatXml extends \Joomla\Registry\Format\Xml {}
class JStringInflector extends \Joomla\String\Inflector {}
class JStringNormalise extends \Joomla\String\Normalise {}
@alex7r
alex7r / html
Last active November 1, 2019 14:34
GA GDP
<?php if($_COOKIE['enable_ga'] && $_COOKIE['enable_ga']!='never'){ ?>
<script type="text/javascript">
jQuery( document ).ready(function($) {
function useAnalytics();
});
</script>
<?php
}elseif($_COOKIE['enable_ga']!='never'){ ?>
<div class="letus-use-cookies-for-ga" style="
position: fixed;