Skip to content

Instantly share code, notes, and snippets.

View faitno's full-sized avatar

Alexey Ch faitno

View GitHub Profile
@faitno
faitno / miniShop2Tagger.php
Last active October 6, 2015 19:06
Plugin for MODx that create port for miniShop2 + Tagger
<?php
switch ($modx->event->name) {
case 'OnDocFormPrerender':
if ($mode !== 'upd') {return '';}
if (!$modx->getObject('msProduct', $id)) {return '';}
if (!$template = $resource->get('template')) {return '';}
$configJs = '
Ext.ComponentMgr.onAvailable("minishop2-product-settings-panel", function() {
this.on("beforerender", function() {
var items = [];
@faitno
faitno / mFilter2Tagger.class.php
Last active April 30, 2020 07:46
Extension for mFilter2 for Tagger
<?php
class TaggerFilter extends mse2FiltersHandler {
public function getTaggerValues(array $groupids, array $ids) {
$filters = array();
$q = $this->modx->newQuery('TaggerTagResource');
$q->innerJoin('TaggerTag', 'TaggerTag', '`TaggerTag`.`id` = `TaggerTagResource`.`tag` AND `TaggerTag`.`group` IN ("' . implode('","', $groupids).'")');
$q->select('TaggerTagResource.resource, TaggerTag.id, TaggerTag.group');
$q->where(array('TaggerTagResource.resource:IN' => $ids));
$tstart = microtime(true);
if ($q->prepare() && $q->stmt->execute()) {
@faitno
faitno / msresourcefile.class.php
Last active August 21, 2019 18:05
ms2gallery 2.5 crop on upload on server-side, watermark
//in public function generateThumbnails(modMediaSource $mediaSource = null)
//before if ($image = $this->makeThumbnail($options, $info)) {
//start center watermark insert
if(isset($options['fltr']) && !is_array($options['fltr'])) $options['fltr'] = [$options['fltr']];
$fltrs = [];
foreach ($options['fltr'] as $fltr){
$width = $this->get('properties')['width'];
$height = $this->get('properties')['height'];
if ($width > $height) {
$h = floor(($height/$width)*$options['w']);
@faitno
faitno / pdotoolscustom.class.php
Created November 16, 2015 12:43
Add custom modificator to fenom on modx
<?php
// /core/model/modx/pdotools/pdotoolscustom.class.php
require_once MODX_CORE_PATH . 'components/pdotools/model/pdotools/pdotools.class.php';
class pdotoolscustom extends pdoTools {
public function getFenom() {
if (!$this->fenom) {
try {
if (!class_exists('Fenom')) {
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@faitno
faitno / private.xml
Last active November 18, 2016 11:51
Karabiner private.xml Mouse MISSION_CONTROL to buttons next, prev. Tested on mouse: Gigabyte M6880
<?xml version="1.0"?>
<root>
<item>
<name>Mouse control chrome and mission control</name>
<identifier>private.mouse.control.chrome.and.missioncontrol</identifier>
<appendix>prev\next tabs in chrome on option+buttons 4,5</appendix>
<autogen>
__KeyToKey__
PointingButton::BUTTON5, ModifierFlag::OPTION_L,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L,
@faitno
faitno / vps-test-dd.md
Created January 28, 2017 07:11 — forked from rictorres/vps-test-dd.md
VPS performance tests

Using dd

RunAbove Sandbox [ra]

  • 1 core / 2 GB RAM / 20 GB SSD

EC2 Micro [ec]

  • 1 core / 1 GB RAM / 8 GB

Digital Ocean [do]

  • 1 core / 512 MB RAM / 20 GB SSD
@faitno
faitno / vram_increase_hackintosh_hd3000
Last active July 21, 2018 14:07
Increase VRAM in hackintosh intel hd3000 512->2048 mb
In clover: `Kernel and Kext Patches`:
name find replace
AppleIntelSNBGraphicsFB C745BC00000020 C745BC00000080
In file: /System/Library/Extensions/AppleIntelHD3000Graphics.kext/Contents/Info.plist
after
```
<key>VRAMOverride</key>
<integer>0</integer>
```
insert:
@faitno
faitno / tv.yandexMaps.input.tpl
Created August 16, 2019 11:27
modx tv yandexMaps with MIGX support
<div id="TVmap"></div>
{$field_full_address_mask = $_config.yandexmaps_field_full_address_mask}
{$fields =
[
'field_full_address' => $_config.yandexmaps_field_full_address,
'country' => $_config.yandexmaps_field_country,
'countryCode' => $_config.yandexmaps_field_countryCode,
'region' => $_config.yandexmaps_field_region,
@faitno
faitno / hd5730 brightness.txt
Last active September 12, 2021 13:44
hd5730 brightness
I would like to share with you what I discovered about "no backlight" (or "the blackscreen") when you install a newer than 13.4 driver pack from AMD.
:D Finally, user from polish forum partially solved this problem.
All you have to do is to launch Registry Editor (regedit), then look for a key
`HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000`
and add there a value: DWORD Value (32-bit). Set the name of the value "KMD_EnableBrightnessInterface2" and set it on "1".
All done, but there is a little problem :p When you set your brightness below ~30% the screen goes dark.