Skip to content

Instantly share code, notes, and snippets.

View sftsk's full-sized avatar

Lukas Jakob Hafner sftsk

View GitHub Profile
@sftsk
sftsk / eurocis-and-logimat.md
Last active April 17, 2018 08:10
Most interesting companies from the fair
@sftsk
sftsk / launch.json
Last active December 18, 2019 16:47
XDebug with Local & Bedrock
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
@sftsk
sftsk / site.conf
Created August 31, 2017 09:36
local by flywheel config for bedrock multisite
server {
server_name _;
return 302 $scheme://domain.dev$request_uri;
}
server {
server_name ~^(.*)\.domain\.dev$ domain.dev;
root /app/public/;
index index.php index.html index.htm;
@sftsk
sftsk / polylang_trans_extractor.js
Created August 18, 2017 08:37
Extractor for Polylang translations
var attrText = "attr_de,attr_it\n";
jQuery('.wp-list-table.widefat.fixed.striped.stringstranslations tbody tr').each(function () {
attrText += jQuery('td[data-colname="Zeichenfolge"]', jQuery(this)).clone().children().remove().end().text() + ',' + jQuery(':text', jQuery(this)).val() + "\n";
});
console.log(attrText);
@sftsk
sftsk / nginx-multisite-fix.conf
Last active June 21, 2022 11:38
fix nginx multisite redirect loop using roots/bedrock
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last;
rewrite ^(/[^/]+)?(/.*\.php) /wp$2 last;
}
@sftsk
sftsk / gist:5a0f1f6df7c5202e7fb487a09be8787a
Created November 8, 2016 10:58
Browser language based forward .htaccess
# redirect first visitors basing on their language or redirect if language not specified
# in URL. If italian, redirect to italian
# if lang is Italian use it
RewriteCond %{THE_REQUEST} !\s/(de|it|app|wp)/ [NC]
RewriteCond %{HTTP:Accept-Language} ^it [NC]
RewriteRule ^ /it%{REQUEST_URI} [L,NC,R=301]
# otherwise use German
RewriteCond %{THE_REQUEST} !\s/(de|it|app|wp)/ [NC]
RewriteRule ^ /de%{REQUEST_URI} [L,NC,R=301]