Skip to content

Instantly share code, notes, and snippets.

View skerbis's full-sized avatar
👋
Huhu

Thomas Skerbis skerbis

👋
Huhu
View GitHub Profile
@skerbis
skerbis / slideshow_augabe.php
Created July 21, 2023 19:32
slidesjow_eingabe.php
<?php
$ylink = [['name' => 'News', 'table'=>'rex_news', 'column' => 'title']];
$auswahl = new Mform();
$auswahl->addFieldsetArea('Settings');
$auswahl->addSelectField(16, array(1=>'Ja',2=>'Nein'), array('label'=>'Autoplay'));
$auswahl->addSelectField(18, array('slide'=>'slide','fade'=>'fade','scale'=>'scale','pull'=>'pull','push'=>'push'), array('label'=>'Übergangs-</br>effekt'));
$auswahl->addSelectField(19, array('ja'=>'Ja',2=>'Nein'), array('label'=>'Navigations-</br>punkte anzeigen'));
$auswahl->addSelectField(20, array('ja'=>'Ja',2=>'Nein'), array('label'=>'Höhe wie Bildschirm'));
echo $auswahl->show();
?>
@skerbis
skerbis / boot.php
Last active May 15, 2023 13:39
REDAXO CKE5 Uikit-Helper // rewrite images to responsive or Lightbox
<?php
if (rex::isFrontend() || rex_be_controller::getCurrentPage() == 'content/edit' && rex_request('function','string')!=='edit'){
rex_extension::register('OUTPUT_FILTER', static function ($ep) {
$html = $ep->getSubject();
$pattern = '/(<figure[^>]*class="[^"]*image[^"]*"[^>]*style="[^"]*width:)(\d+)(%;[^"]*">)(.*?)(<\/figure>)/s';
$new_html = preg_replace_callback($pattern, function ($matches) {
$width_map = [
'100' => 'uk-width-1-1',
@skerbis
skerbis / click.js
Created January 17, 2023 09:31
clickable div with uikit3
<script>
// select all div elements with the class "card"
const cards = document.querySelectorAll(".a-div-link");
// iterate over the NodeList of div elements
cards.forEach((card) => {
// add a tabindex attribute to the div to make it focusable
card.tabIndex = 0;
// add a role attribute with the value "link" to announce the div as a link to screen reader users
@skerbis
skerbis / image-picker-with-simple-cropping.markdown
Created October 23, 2020 10:03
Image Picker With Simple Cropping

Image Picker With Simple Cropping

A UI component for a user to select an image from their file system for upload to a data store or rendering on a page. The values in the "config" section define the final desired image size as well as the size of the preview window displayed on the page. Change these to your desired preferences.

A Pen by Dave Hanagan on CodePen.

License.

@skerbis
skerbis / index.html
Created October 23, 2020 09:36
ng-crop reactangle with aspect
<table ng-app="app" ng-controller="Ctrl">
<td>
<div>Select an image file: <input type="file" id="fileInput" /></div>
<div class="cropArea">
<ui-cropper image="myImage" area-type="rectangle" aspect-ratio="1.7" result-image="myCroppedImage" result-image-size='{w: 340,h: 200}' init-max-area="true"></ui-cropper>
</div>
</td>
<td>
<div>Cropped Image:</div>
<div><img ng-src="{{myCroppedImage}}" /></div>
@skerbis
skerbis / reset.css
Last active October 30, 2019 12:19 — forked from rn404/reset.css
reset.css
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
<?php
// Function zur Generierung eines Navigationsarrays
// Benötigt für den Aufruf werden nur $start,$depth und $ignoreoffline
// Alle weiteren Angaben dienen der internen Verarbeitung
// Alle weiteren Informationen aus rex_structure fintet man in catObject
// DEMO siehe unten
if (!function_exists('structureArray')) {
function structureArray($start = 0, $depth = 0, $ignoreoffline = true, $depth_saved = 0, $level = 0, $id = 0)
{
$result = array();
@skerbis
skerbis / Snom.scpt
Created October 5, 2018 07:25 — forked from jfqd/Snom.scpt
This script enables the macOS Contact-Application to dial a phone-number via a SNOM hardware phone by clicking on the phone label
-- This script enables the macOS Contact-Application to dial a phone-number
-- via a SNOM hardware phone by clicking on the phone label.
--
-- (C) 2008 David Kreitschmann, K3com Kommunikationstechnik http://www.k3com.de
-- (C) 2017 Modification for SNOM 715 by Stefan Husch, https://qutic.com
--
-- Copy this script to ~/Library/Application\ Scripts/com.apple.AddressBook
-- on your macOS 10.11+ and change the phoneURL to your needs.
--
-- A chmod 0600 ~/Library/Application\ Scripts/com.apple.AddressBook/Snom.scpt
@skerbis
skerbis / download-unzip.php
Last active August 21, 2018 16:00 — forked from sedflix/download-unzip.php
Download and unzip file with PHP
<?php
$ch = curl_init();
$source = "https://yourDomain.tld/file.zip";
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);
// Save file