Skip to content

Instantly share code, notes, and snippets.

View stoll's full-sized avatar
🚧
Digital construction worker

stoll stoll

🚧
Digital construction worker
View GitHub Profile
@stoll
stoll / swiss-cantons-php-array.php
Created October 21, 2023 13:36
PHP array of all Swiss cantons (in German, French, Italian, Romanian, and English)
<?php
return [
"AG" => [
"name" => [
"de" => "Aargau",
"fr" => "Argovie",
"it" => "Argovia",
"rm" => "Argovia",
"en" => "Argovia",
],
@stoll
stoll / Url.php
Created January 10, 2022 12:29
Url.php
<?php
class Url
{
protected $scheme; // - e.g. http
protected $host; //
protected $port; //
protected $user; //
protected $pass; //
protected $path; //
@stoll
stoll / parse_url_reverse.php
Created January 10, 2022 12:14
parse_url_reverse.php
function parse_url_reverse(array $parts)
{
$scheme = isset($parts['scheme']) ? ($parts['scheme'] . '://') : '';
$host = $parts['host'] ?? '';
$port = isset($parts['port']) ? (':' . $parts['port']) : '';
$user = $parts['user'] ?? '';
$pass = isset($parts['pass']) ? (':' . $parts['pass']) : '';
$pass = ($user || $pass) ? ($pass . '@') : '';
@stoll
stoll / contact-info.txt
Created September 14, 2020 17:08
💡 Want to discuss a project?
Feel free to write me an e-mail!
@stoll
stoll / greeting.txt
Last active September 14, 2020 17:09
🙋‍♂️ Welcome to my Github!
Nice to see you :-)
@stoll
stoll / INSTALL-SHOPWARE-SIX.md
Last active July 2, 2020 13:47 — forked from MadMikeyB/INSTALL-SHOPWARE-SIX.md
Shopware 6 - Laravel Valet Driver

Install Shopware 6 (For Development)

cd ~/sites
valet park
# clone shopware
git clone -b 6.1 https://github.com/shopware/development.git shopware
# change directory
cd shopware
# install dependencies
@stoll
stoll / checkout.liquid
Created June 25, 2020 05:05 — forked from bxmas13/checkout.liquid
Shopify Plus Checkout.liquid template. Can be used with Timber
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="{{ locale }}" dir="{{ direction }}" class="{{ checkout_html_classes }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">
<title>{{ shop.name }} - {{ page_title }}</title>
{{ content_for_header }}
function str_slug($title, $separator = '-') {
// Convert all dashes/underscores into separator
$flip = $separator == '-' ? '_' : '-';
$title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
// Replace @ with the word 'at'
$title = str_replace('@', $separator.'at'.$separator, $title);
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
@stoll
stoll / Cors.php
Created June 12, 2017 13:22
Cors middleware
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.