Skip to content

Instantly share code, notes, and snippets.

View smichaelsen's full-sized avatar
🥋
Changing the world in code

Sebastian Michaelsen smichaelsen

🥋
Changing the world in code
View GitHub Profile
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@jemus42
jemus42 / amzn_scrp.R
Created December 15, 2016 22:09
Simple amazon scraper with slack notification because @danjel
library(rvest) # Parse HTML
library(httr) # Send POST request, I think rvest depends on that anyway
url <- "https://www.amazon.de/dp/B01M0LHEZI"
slack_url <- "somewebhookurlimtoolazytoget"
avail <- read_html(url) %>%
html_node("#availability :first-child") %>%
html_text(trim = T)
@NamelessCoder
NamelessCoder / injectionmethods.md
Last active February 12, 2020 15:59
Why you should never use @Inject in TYPO3 Extbase

This mini-article describes the methods of dependency injection, what each method implies in terms of both performance and simplicity.

  1. Constructor injection

This method is half manual and quite well known. Declare your classes' dependencies as constructor and pass the dependencies when you construct your instances. This approach completely skips the automation around detection of injections - but performs the best of all methods.

@JonCole
JonCole / Redis-BestPractices-General.md
Last active March 13, 2025 14:30
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@smichaelsen
smichaelsen / gitlab_typo3_setup.md
Last active August 12, 2022 14:11
Setting up a Build Server for TYPO3 projects on Gitlab.com

Setting up a Build Server for TYPO3 projects on Gitlab.com

Background

We're a small team of only two people, but we're tackling more and more rather big TYPO3 projects. Over time we introduced package management for PHP (composer) and JS (bower) and depended on frontend building with Grunt. With rising complexity and importance of our projects we felt the demand for an efficient and safe way to deploy our websites on different servers.

We helped our selves with small self written deploy scripts that performed building on the target server, but you can't run node (for Grunt) or sass in every environment, and if building goes wrong the website was likely to be broken on the live server - so we needed a Build Server.

But solutions we looked at turned out to be quite time consuming (setting up and managing self hosted Gitlab and Gitlab-CI or a Jenkins server and runners) or costly.

Free Hosting on Gitlab.com

@helhum
helhum / install.sh
Last active January 10, 2023 15:38
Unattended TYPO3 7LTS installation (including introduction package)
composer create-project typo3/cms-base-distribution='^7.6.0' my-test-typo3 --no-interaction
cd my-test-typo3/
composer require helhum/typo3-console
# This will only work with PHP < 7 as realurl need PHP 5.x
composer require typo3-ter/introduction
cp web/typo3conf/ext/typo3_console/Scripts/typo3cms .
cp web/typo3conf/ext/bootstrap_package/Configuration/Apache/.htaccess web/
chmod +x typo3cms
./typo3cms install:setup --non-interactive --database-user-name="root" --database-user-password="root" --database-host-name="localhost" --database-port="3306" --database-name="t3_my_test" --admin-user-name="admin" --admin-password="password" --site-name="Auto Install"
./typo3cms database:updateschema '*.*'
@githubrsys
githubrsys / readme.md
Last active July 20, 2022 09:59
TYPO3 fluid VHS: Group elements with wrap without Modulo

Summary

Imagine you have a list of elements. E.g. some DIV's (or something else) and you want to surround or wrap blocks or chunks of 3 with an <li> element.

Expected output Code

<li>
foo
@smichaelsen
smichaelsen / kata1.md
Created October 1, 2015 12:47
MySQL Kata #1
+------+-------+
| type | value |
+------+-------+
| a    | 2     |
+------+-------+
| a    | 5     |
+------+-------+
| c    | 1     |
+------+-------+

| b | 8 |

@htuscher
htuscher / Suggest.html
Last active April 26, 2019 17:49
TYPO3 Solr Autosuggest and Autocomplete using Extbase and TypeNum Ajax
<f:layout name="Default" />
<f:section name="Main">
<button type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<div class="row">
<div class="col-md-9">
<div class="row">
<f:for each="{suggest}" as="sug">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
@L3viathan
L3viathan / kinox
Last active April 19, 2025 11:24
Using the undocumented kinox.to API, extract stream URLs from a query.
#!/bin/sh
# Get stream URLs for the second episode of the seventh season of futurama:
# kinox.sh futurama 7 2
# for shows with spaces, insert a plus sign instead:
# kinox.sh it+crowd 3 1
# grab the stream by searching for the show on kinox.to, filtering to only show english versions, and extracting the internal show name
export stream_page=$(curl -sL "http://kinox.to/Search.html?q=$1" | pcregrep -M 'lng\/2\.png(\n|.)+?class="Title"' | pcregrep -o1 'Stream\/(.+?)\.html' | head -n 1)
# get the show's page, with the undocumented additional parameters for season and episode, and grab the "rel" attribute of the hoster list