Skip to content

Instantly share code, notes, and snippets.

View zooks's full-sized avatar

zooks zooks

View GitHub Profile
@zooks
zooks / nginx.conf
Created August 17, 2017 08:51
nginx trailing slash
location / {
rewrite ^(/(?!backend).*[^/])$ $1/ permanent;
try_files $uri /index.php$is_args$args;
}
@zooks
zooks / october-redirect.php
Created August 24, 2017 14:21
October CMS Redirect
public function onStart()
{
return Redirect::to('http://google.com');
}
@zooks
zooks / october-get-param.php
Created August 24, 2017 14:38
October CMS get param
function onStart()
{
$this['search_query'] = get('q', $default = null);
}
@zooks
zooks / october-set-page-title.php
Created August 24, 2017 15:29
October CMS redefine Page Title
function onEnd()
{
$this->page->title = 'A different page title';
}
@zooks
zooks / touchegg.conf
Last active June 16, 2023 11:05
Touchegg config for XFCE ~/.config/touchegg/touchegg.conf
<touchégg>
<settings>
<property name="composed_gestures_time">111</property>
</settings>
<application name="All">
<gesture type="DRAG" fingers="1" direction="ALL">
<action type="DRAG_AND_DROP">BUTTON=1</action>
</gesture>
<gesture type="DRAG" fingers="3" direction="RIGHT">
<action type="SEND_KEYS">Control+Alt+Right</action>
@zooks
zooks / .gitignore
Created December 14, 2017 23:00
gitignore for October CMS
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@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
@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 / 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 / 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());