Skip to content

Instantly share code, notes, and snippets.

View intersel's full-sized avatar
😸

EpopE intersel

😸
View GitHub Profile
@intersel
intersel / GotoURL.snippet.php
Last active April 23, 2022 17:05
MODX snippet to redirect a page to another URL
<?php
/****************************************************
Redirect the page to another URL
Parameters:
- gotoURL : a resource ID or an URL
- dontGoto : default:false, if true, do nothing...
Usage:
[[GotoURL? &gotoURL=`10` &dontGoto=`1`]]
@intersel
intersel / scanDirectory.snippet.php
Created May 30, 2016 12:42
Modx snippet to list the files present in a file folder
<?php
/****************************************************
List the files present in a file folder
Parameters:
- &directory: directory to scan
- &templateChunk (default:void): a chunk to parse on each found file
- &random (default =`0`): if true, the file list output is randomized
- &filterSubDirectory (default=`0`): if true, won't show the sub directory
- &implodeSeparator (default="\n"): a separator to use to implode the file lines or parsed chunk file lines
@intersel
intersel / EscapeModx.php
Last active June 22, 2018 21:38
escapeModxTags - Escape MODX Tags with a plugin (REVO)
<?php
/****
This plugin escapes modx tags that are enclosed in %EscapeModx% %/EscapeModx% tags.
eg in a resource content in a RTE:
%EscapeModx%
[[!AndIf?
&condition=`[[+description]]%%notempty%%1||[[+urlLink]]%%notempty%%1`
&operator=`OR`
@intersel
intersel / getUserGroupsforResource.snippet.php
Last active September 4, 2022 18:09
getUserGroupsforResource - A MODX Snippet that returns the user groups that have access to a resource id
<?php
/*
Snippet :getUserGroupsforResource
Abstract: get infos on the groups on a given resource
Example:
[[getUserGroupsforResource?&id=12]]
Input:
- id: (default:current resource) the id of the resource
- returnInfo (default:'all') :
@intersel
intersel / draw_circle.js
Last active October 25, 2022 10:11
Drag to create a circle or oval in a canvas element
/*
Original version: http://jsfiddle.net/m1erickson/3SFJy/
code HTML
---------
<html>
<canvas id="canvas" width=300 height=300></canvas>
</html>
code CSS
--------
@intersel
intersel / SquareBootstrapSections.html
Last active January 19, 2023 13:48
Square bootstrap sections
<!--
Create squared blocks with a bootstrap configuration
-->
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<style>
.square {
height: auto;
border-left: 1px solid green;
@intersel
intersel / animatedColoredBackground.html
Created December 16, 2022 18:27
create an animated colored background of a section
<html>
<head>
<style>
@keyframes AnimationBackground {
0%{background-position:90% 0%}
50%{background-position:11% 100%}
100%{background-position:90% 0%}
}
.animatedBackground {
background: linear-gradient(270deg, #6cccb3, #8891e1, #dd4d9e,#f37e0b);
@intersel
intersel / SectionDivider.html
Created January 19, 2023 13:46
Section Divider using svg waves
<style>
:root {
--shape-fill-color: rgb(95, 176, 5);
--shape-height: 100px;
--shape-width: 100%;
}
body {
margin: 0;