Skip to content

Instantly share code, notes, and snippets.

Avatar

Yannik Preiß ypsilon-p

  • Cologne
View GitHub Profile
@ypsilon-p
ypsilon-p / .gitignore
Created Mar 12, 2020
Git ignore for production wp sites
View .gitignore
node_modules/
.idea/
wp-content/uploads
wp-content/cache
@ypsilon-p
ypsilon-p / gulpfile.js
Created Sep 30, 2019
default gulp workflow
View gulpfile.js
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const path = require('path');
const minifyCSS = require('gulp-minify-css');
const prefix = require('gulp-autoprefixer');
View client.js
jQuery.post(
my_foobar_client.ajaxurl,
{
'action': 'foobar',
'foobar_id': 123
},
function(response) {
console.log('The server responded: ', response);
}
);
@ypsilon-p
ypsilon-p / gulpfile.js
Last active Sep 30, 2019
A simple workflow for gulp.. Includes concat and minfying for SCSS and JS files. Folder structure must be "src/js" and "src/scss".
View gulpfile.js
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
const plumber = require('gulp-plumber');
const notify = require('gulp-notify');
const path = require('path');
const minifyCSS = require('gulp-minify-css');
const prefix = require('gulp-autoprefixer');
View bootstrap4snippets.css
/**
* Fix a known issue from bootstrap 4. This is important to get the images responsive.
* It's a known bs4 issue: https://github.com/twbs/bootstrap/issues/21611
**/
.carousel-item.active {
display:block;
}
@ypsilon-p
ypsilon-p / php-ios-version.php
Last active Sep 28, 2017
A simple php snippet to detect the iOS-version of the user.
View php-ios-version.php
/**
* This snippet detect the iOS-Version. It use HTTP_USER_AGENT which result is the following:
* iOS 10!Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8
* (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1
*
* strpos() search the String "iPhone OS 10". More information about strpos(): http://php.net/manual/de/function.strpos.php
* If you need to detect another version just change the version e.g. 'iPhone OS 10_3' will detect all devices with iOS version 10_3.
* Another possibility is to use mobile-detect: http://mobiledetect.net/
*/
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'iPhone OS 10' ) !== false ) {