Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Schulz-Lauterbach stefansl

View GitHub Profile
View contao-4-lokales-bundle.md

Contao 4 Lokales Bundle

Mit der folgenden Anleitung wird ein lokales Contao 4 Bundle angelegt, das ein Inhaltselement mit der Ausgabe "Hello World" erzeugt.

Das Bundle wird nicht über Composer installiert, sondern einfach in die Anwendung gelegt. Es wird nicht das AppBundle verwendet, sondern ein eigener Vendor und Bundle Name.

Der Vendor Name für das Beispiel ist "Acme" der Bundle Name "TestBundle". Diese Strings müssen bei einem eigenen Bundle entsprechend ersetzt werden.

Bundle Erstellung

@avafloww
avafloww / PhpJava.java
Last active Dec 4, 2020
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
View PhpJava.java
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@juliangruber
juliangruber / extend.plist
Last active Aug 23, 2020
Here is how to accept files dropped on an @electronjs app's icon in osx. For this to work you need to properly package the app into a `.app`, and to place the CFBundleDocumentTypes spec into it's Info.plist. Here we're using electron-packager.
View extend.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>LSHandlerRank</key>
@shyim
shyim / Gulpfile.js
Last active Nov 27, 2018
Gulp Shopware with browser-sync
View Gulpfile.js
function basename(path) {
return path.split('/').reverse()[0];
}
var gulp = require('gulp'),
less = require('gulp-less'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
path = require('path'),
fs = require('fs'),
@RavuAlHemio
RavuAlHemio / contao3.conf
Last active Jul 21, 2017
Contao 3 and 4 nginx.conf
View contao3.conf
index index.php index.html;
location ~ ^/(favicon\.ico|robots\.txt)$ {
allow all;
log_not_found off;
access_log off;
}
# don't show templates
location ~* \.(tpl|html5|xhtml)$ {
@natelandau
natelandau / .bash_profile
Last active Jul 30, 2021
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@johndwells
johndwells / .htaccess
Created Feb 26, 2013
One htaccess to rule them all. Combo of 5G Blacklist + HTML5Boilerplate + EECMS.
View .htaccess
# ----------------------------------------------------------------------
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 5G:[QUERY STRINGS]
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
@jareware
jareware / SCSS.md
Last active Jul 31, 2021
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do
View SCSS.md

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@leofeyer
leofeyer / contao-db-update.php
Created Aug 9, 2012
Update path in database
View contao-db-update.php
<?php
// Database credentials
$strHost = 'localhost';
$strUser = '';
$strPassword = '';
$strDatabase = '';
// From and to path
$strFrom = 'tl_files/';