Skip to content

Instantly share code, notes, and snippets.

View kaesetoast's full-sized avatar
🤔
Coding

Philipp Nowinski kaesetoast

🤔
Coding
View GitHub Profile
@kaesetoast
kaesetoast / dev-apache-vhost
Created May 30, 2013 21:11
Template for Apache vhost
<VirtualHost *:80>
ServerName {sitename}.dev
DocumentRoot /var/www/{sitename}/
<Directory /var/www/{sitename}/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/{sitename}-error.log
@kaesetoast
kaesetoast / apache-jenkins-proxy
Last active July 12, 2017 10:34
Template for Apache vhost that tunnels jenkins
<VirtualHost *:80>
ServerName ci.{domain}.{tld}
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyRequests Off
ProxyPreserveHost On
<proxy http://127.0.0.1:8080*>
Order deny,allow
Allow from all
@kaesetoast
kaesetoast / CSS magic
Created March 24, 2014 13:33
HTML, CSS, JS tricks
/* apply a natural box layout model to all elements */
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
@kaesetoast
kaesetoast / 0_reuse_code.js
Created March 25, 2014 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php // HTTP Headers for ZIP File Downloads
// http://perishablepress.com/press/2010/11/17/http-headers-file-downloads/
// set example variables
$filename = "Inferno.zip";
$filepath = "/var/www/domain/httpdocs/download/path/";
// http headers for zip downloads
header("Pragma: public");
header("Expires: 0");
@kaesetoast
kaesetoast / fix-duplicate icon
Created November 18, 2014 10:33
Fix duplicate Chrome icon in Plank
sudo sed -i -r 's/(\[.+\])$/\1\nStartupWMClass=Google-chrome-stable/g' /usr/share/applications/google-chrome.desktop
@kaesetoast
kaesetoast / dynamic-gulp-dest
Last active March 10, 2017 20:58
write gulp output to dynamic destinations
return gulp.src('app/**/scss/++/*.scss')
.pipe(sass())
.pipe(gulp.dest(function(files) {
return path.join(file.base, '../css');
}));
$('.js-popup-link').each(function(){
var url = $(this).attr('href');
url += (url.split('?')[1] ? '&':'?') + 'type=103';
$(this).attr('data-mfp-src', url);
});
$('.js-popup-link').magnificPopup({
type: 'ajax',
callbacks: {
parseAjax: function(response) {

CSS Custom Properties are Variables. Just cooler.

If you are using some kind of Preprocessors like Sass, Less, or Stylus, you probably are familiar with the concept of variables in CSS. So now we have the same thing in the Browser – right? Well. Kinda. But better.

Let's explore what makes custom properties different from variables and why they are so much more powerful. Together, we will dive into some real-world examples to see how custom properties can help with some of the challenges of responsive design, theming and a component-driven CSS-architecture.

Custom Properties are well supported among modern browsers and you can use them today! Internet Explorer is still relevant to your customers? – Worry not! We will also take a look at possible fallback strategies for serving legacy browsers.

@kaesetoast
kaesetoast / datalayer.php
Last active January 5, 2020 09:11
DataLayer
// The dataLayer JavaScript is generated inside of a smarty template. All variables in curly-braces have to be replaced
// with whatever your system provides you with.
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
event: "orderCompleted",
transactionId: '{$sOrderNumber}', // Transaction ID. Required for purchases and refunds.
transactionTotal: {if $sAmountWithTax && $sUserData.additional.charge_vat}{$sAmountWithTax}{else}{$sAmount}{/if}, // Total transaction value (incl. tax and shipping)
transactionTax: {$sAmountTax},