Skip to content

Instantly share code, notes, and snippets.

View maximilian-mayer's full-sized avatar

Maximilian Mayer maximilian-mayer

View GitHub Profile
@ddprrt
ddprrt / Gulpfile.js
Last active May 8, 2020 21:11
Gulp: Grabbing JavaScript assets from a CDN to add to your build pipeline
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var request = require('request');
var merge = require('merge2');
var concat = require('gulp-concat');
var buffer = require('gulp-buffer');
/**
* 1. We request the latest jQuery version from the jQuery CDN. The
* request package allows for streaming. What we get in return
// Exclude Piwik and Google Analytics parameter from cHash
$GLOBALS['TYPO3_CONF_VARS']['FE']['cHashExcludedParameters'] .= ', pk_campaign, pk_kwd, utm_source, utm_medium, utm_campaign, utm_term';
@nailton
nailton / multiexplode.php
Created March 25, 2015 16:29
Multi explode PHP
<?php
function multiexplode ($delimiters,$string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
// uso
$exploded = multiexplode(array(",",".","|",":"),$text);
@h3nn3s
h3nn3s / installTypo3.sh
Last active January 2, 2017 09:15
Bash-Script for installing latest TYPO3 sources and fetching things from github
#!/bin/bash
url="http://get.typo3.org/7"
target="t3latest.tar.gz"
workingdirectory=${PWD}
clear
echo "Getting the TYPO3 Sources from ${url}, writing to ${target}"
# get the sourcec
@xperseguers
xperseguers / controller.php
Last active April 4, 2023 07:56
Upload files in TYPO3 from Frontend
/**
* Upload files.
*
* @return void
*/
public function uploadAction() {
$overwriteExistingFiles = TRUE;
$data = array();
$namespace = key($_FILES);
@maddesigns
maddesigns / lib.adaptive-images
Created August 29, 2013 12:15
TYPO3 Snippet for Adaptive Images with <noscript> Sample: http://t3ip.maddesigns.de/examples/adaptive-images-noscript/
#adaptive images lib for TYPO3
lib.adaptive-images = COA
lib.adaptive-images {
1 = TEXT
1.value = <figure class="csc-textpic-imagecolumn###CLASSES###"><noscript
10 = IMG_RESOURCE
10 {
file.import.current = 1
file.maxW = 480
file.override.data = {$styles.content.imgtext.maxW}
@kenzie
kenzie / craft.conf
Last active May 17, 2018 17:48
Nginx virtual host configuration for Craft CMS, PHP5-FPM, NGINX 1.2.1 and craft/config/general.php for friendly URLs.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
<?php
$src = 'http://player.vimeo.com/video/1234';
preg_match('!video\/([0-9]+)!i', $src, $match);
$id = $match[1];
$apiurl = 'http://vimeo.com/api/v2/video/' . $id . '.json';
$response = file_get_contents($apiurl);
$json = json_decode($response, true);
(function($) {
$.fn.smoothScroll = function() {
return this.on('click', function() {
var hash = $(this).attr('href');
var dest = $(hash).offset();
$('html:not(:animated),body:not(:animated)').animate({scrollTop: dest.top, scrollLeft: dest.left}, 500, function() {
window.location.hash = hash;