Skip to content

Instantly share code, notes, and snippets.

View zooks's full-sized avatar

zooks zooks

View GitHub Profile
@zooks
zooks / cleave-js-class.js
Created August 29, 2022 16:13
Cleave.js apply to all elements with specific classname
window.onload = function () {
var datesCollection = document.getElementsByClassName("input-date");
var dates = Array.from(datesCollection);
dates.forEach(function (date) {
new Cleave(date, {
date: true,
delimiter: '-',
datePattern: ['Y', 'm', 'd']
})
@zooks
zooks / app.js
Created August 29, 2022 16:09
cleave-js-phone-russia
var cleave = new Cleave('.phone-mask', {
// prefix: '+7 ',
numericOnly: true,
blocks: [0, 3, 3, 2, 2],
delimiters: ["+7 (", ") ", " ", "-", "-"]
});
--------------------
----------------
|^^^пиво^^\\|""\\_,_
|___________||___|__|)
(@)(@)""*|(@)(@)**(@)
@zooks
zooks / grub.conf
Created February 11, 2020 18:34
Windows Boot Manager (on /dev/sda1)
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 040D-E584
else
search --no-floppy --fs-uuid --set=root 040D-E584
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
md "OptimizedJPEGS"
for %%i in (*.jpg) do "C:\Program Files (x86)\GnuWin32\bin\jpegtran.exe" -optimize -progressive -copy none "%%i" > "OptimizedJPEGS\%%i"
@zooks
zooks / modx-tags.txt
Created May 29, 2019 15:15
MODX Tags
Name Tag Example output
Site URL [[++site_url]] http://localhost/revo/
Base Path [[++base_path]] C:/xampp/htdocs/revo/
Base URL [[++base_url]] /revo/
Core path [[++core_path]] C:/xampp/htdocs/revo/core/
Manager Path [[++manager_path]] C:/xampp/htdocs/revo/manager/
Manager URL [[++manager_url]] /revo/manager/
Processors path [[++processors_path] C:/xampp/htdocs/revo/core/model/modx/processors/
Assets path [[++assets_path]] C:/xampp/htdocs/revo/assets/
Assets URL [[++assets_url]] /revo/assets/
@zooks
zooks / Plugin.php
Created June 17, 2018 19:37
October debug plugin
<?php namespace Qwer\Asdf;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function boot()
{
//dump(\App::getFacadeApplication()['db.connection']->getPDO());
// dump(base_path(), themes_path());
@zooks
zooks / template.html
Last active May 4, 2018 16:23
MODX Fenom MIGX
{set $index = 0}
{set $slider = json_decode($_modx->resource.slider, true)}
{foreach $slider as $row}
<div>
<img src="{$row.image | phpthumbon : 'w=1920&zc=0'}" title="{$row.heading}" alt="{$row.heading}">
<a href="{$row.link}">
{$row.content}
</a>
</div>
@zooks
zooks / october-page.htm
Created January 19, 2018 22:23
October Page Filters
<a href="{{ ''| page }}">Current page with current filter slugs</a>
<a href="{{ ''| page(false) }}">Current page without any filter slugs (except default value)</a>
<a href="{{ ''| page({ filter_slug:slug_var, filter_id:id_var }) }}">Current page with needle filter slugs</a>
@zooks
zooks / update-modx.sh
Created December 24, 2017 06:04
Update MODX
#!/bin/bash
echo Please specify MODX version:
read version
echo Downloading MODX $version...
wget https://modx.com/download/direct?id=modx-$version-pl.zip
unzip direct\?id\=modx-$version-pl.zip && rm direct\?id\=modx-$version-pl.zip