Skip to content

Instantly share code, notes, and snippets.

@Megafry
Megafry / index.html
Last active September 22, 2016 19:32
Bootstrap 3 - "data-parent" exemple (minimal code)
<!--
http://stackoverflow.com/questions/19425165/bootstrap-3-accordion-button-toggle-data-parent-not-working
There is a "bug" that makes the accordion dependent on the .panel class when using the data-parent attribute. To workaround it, you can wrap each accordion group in a 'panel' div..
-->
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseOne">Item #1</a>
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseTwo">Item #2</a>
<a data-toggle="collapse" data-parent=".accordion19" href="#collapseThree">Item #3</a>
@Megafry
Megafry / _form.less
Last active September 22, 2016 19:42
bootstrap 3 easy form styling
/* juste add the class defaultForm to the form Element*/
.defaultForm {
input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="submit"]):not([type="reset"]),
textarea,
select {
display: block;
width: 100%;
.form-control;
@Megafry
Megafry / GoogleMapMarkers.js
Created October 8, 2016 11:43
Google Map Markers Exemple
//original code from http://jsfiddle.net/07cwyj6n/
//var icon = "https://cdn0.iconfinder.com/data/icons/social-networks-and-media-flat-icons/136/Social_Media_Socialmedia_network_share_socialnetwork_network-14-512.png";
/*
var icon = {
url: "https://cdn0.iconfinder.com/data/icons/social-networks-and-media-flat-icons/136/Social_Media_Socialmedia_network_share_socialnetwork_network-14-512.png", // url
scaledSize: new google.maps.Size(30, 30), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(15, 15) // anchor
};
@Megafry
Megafry / index.html
Created October 23, 2016 15:13
Google Map API3 with Custom infowindow and marker + markerclusterer
<!DOCTYPE HTML>
<html>
<head>
<title>GoogleMap</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style>
@Megafry
Megafry / sys_file_reference.php
Created June 2, 2017 07:56
TYPO3 7.X overwrit default crop aspect ratio's for sys_file_reference
<?php
defined('TYPO3_MODE') or die();
$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['ratios'] = array(
'1.7777777777777777' => '16:9',
'1.3333333333333333' => '4:3',
'1' => '1:1',
'2.380952381' => 'Slider',
'1.66666666666666666' => 'Slider Mobile',
'NaN' => 'Free',
@Megafry
Megafry / cmd.php
Created October 11, 2018 10:21
cmd.php
<html lang="de">
<head>
<meta charset="utf-8">
<title>cmd box by Megafry</title>
<style>
body {
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
}
* {
@Megafry
Megafry / FizzBuzz.js
Last active March 21, 2020 11:32
FizzBuzz challenge
const numberOfLoops = 100
const numbersToReplace = [ [3,'Fizz'], [5,'Buzz'] ]
for(i=1;i<=numberOfLoops;i++){
r = numbersToReplace.filter( replacement => !(i % replacement[0]))
console.log( r.length ? r.map(result => result[1]).join('') : i )
}
@Megafry
Megafry / .htaccess
Created May 14, 2020 08:38
Favicon redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} webpage2\.com$ [NC]
RewriteRule ^favicon\.ico$ /webpage2_favicon.ico [L,NC]
@Megafry
Megafry / parseFunc.typoscript
Last active November 5, 2020 13:46
TypoScript to extend TYPO3 parseFunc, adding the file-extention and size to all link
lib.parseFunc {
tags.a.typolink {
#add text in the A-Tag
ATagBeforeWrap = 1
wrap.cObject = FILES
wrap.cObject {
#get file ID
files.stdWrap {
data = parameters:href
stdWrap.replacement {
@Megafry
Megafry / parseFunc.typoscript
Created September 23, 2020 11:29
TypoScript to extend TYPO3 lib.parseFunc by adding the file-extention as data attribute without userFunc.
lib.parseFunc {
tags.a.typolink {
ATagParams.stdWrap.cObject = FILES
ATagParams.stdWrap.cObject {
stdWrap.if {
isPositive.data = parameters:href
isPositive.stdWrap.replacement {
10 {
search = t3://file?uid=
replace =