Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@buren
buren / check_redirect.rb
Created August 16, 2018 12:58
Given a CSV file with expected redirects - verify that each redirect is performed correctly.
#!/usr/bin/env ruby
# USAGE:
# $ check_redirects --help
# or
# $ ruby check_redirects.rb --help
require 'bundler/inline'
gemfile do
@t3easy
t3easy / .gitlab-ci.yml
Last active June 14, 2024 11:45
Build and deploy docker containers with GitLab CI
image: an-image-with-docker-and-docker-compose
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker"
before_script:
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem
@einpraegsam
einpraegsam / ReadableDateViewHelper.php
Created July 24, 2018 14:28
ReadableDateViewHelper to show a date in TYPO3 Fluid with a readable date like: "2 Minutes ago", "4 hours ago", "2 days ago" or a date. Tipp: use a normal date viewhelper date in a title-attribute in a wrapping (e.g.) span tag to have a exact date and time while hovering the readable date.
<?php
declare(strict_types=1);
namespace In2code\Lux\ViewHelpers\Format;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Class ReadableDateViewHelper
*
var CronJob = require('cron').CronJob;
var job = new CronJob({
cronTime: '00 */5 * * * *',
onTick: function() {
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({width: 1920, height: 1080});
@helhum
helhum / composer.json
Last active February 12, 2024 10:54
The (currently) ideal TYPO3 composer setup
{
"require": {
"typo3-console/composer-auto-setup": "^0.1",
"georgringer/news": "^6.1",
"helhum/typo3-secure-web": "^0.2.5",
"typo3/cms-introduction": "^3.0"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
@svenk
svenk / yaml-reader.php
Created November 3, 2017 17:53
Multi document YAML reader for PHP
<?php
/*
* There is currently no pure PHP yaml parser capable of reading
* multi documents (--- separated). I have tested both spyc and Symfony's YAML.
*
* Therefore I parse YAML with Python, encode it to json and read the json in
* PHP. The json is cached on disk.
*
* Public Domain by http://github.com/svenk
*/
@helhum
helhum / setup.sh
Created October 29, 2017 14:08 — forked from sascha-egerer/setup.sh
Install script for my personal tool chain (Mac OS)
#!/bin/bash
set -e
# insert a line to a file if the line does not already exist
# - first parameter is the file to insert the line
# - second parameter is the line to insert. It'll only be inserted if not already exists
# - third parameter is optional. This will override the search behavior.
# Instead of searching for the line of parameter 2 this term is used.
function insertLineIfNotExists {
FILE=$1
@fallroot
fallroot / manipulating-plist-in-macos-cli.md
Created August 7, 2017 06:08
Manipulating Property List in macOS Command Line

Manipulating Property List in macOS Command Line

Tools

⚠️ defaults 명령어는 홈 경로(~)는 인식하지만 상대 경로(., ..)는 인식하지 않는다.

@peterkraume
peterkraume / Page.ts
Created July 20, 2017 09:51
Backport for TYPO3 8.7: PageLayoutView - Allow to disable copy- / translate- buttons
mod {
web_layout {
// disable translation mode for content elements
// backported feature from TYPO3 9.x. See Xclass PageLayoutView.php for details
localization.enableTranslate = 0
}
}
@t3easy
t3easy / .gitlab-ci.yml
Last active January 22, 2020 18:36
GitLab CI
cache:
# Use a cache for every branch and every stage
key: "$CI_COMMIT_REF_NAME/$CI_JOB_STAGE"
# Cache the path .cache within the project workspace
paths:
- .cache/
variables:
# Tell composer to save and load it's cache within the .cache folder
COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/.cache/composer"