Skip to content

Instantly share code, notes, and snippets.

View BenRichter's full-sized avatar
🎯
Focusing

Ben Richter BenRichter

🎯
Focusing
View GitHub Profile
@BenRichter
BenRichter / checkbox.html
Created July 10, 2014 08:28
Custom Checkbox
<form method="post" action="#">
<label class="radio">
<span class="styled"><input id="optionsRadios1" type="radio" checked="" value="option1" name="optionsRadios" checked></span>
Ja
</label>
<label class="radio">
<span class="styled"><input id="optionsRadios2" type="radio" value="option2" name="optionsRadios"></span>
Nein
</label>
<label class="radio">
@BenRichter
BenRichter / ieIframeFix.js
Created July 10, 2014 08:32
IE iframe z-index fix (z.B. Youtube)
jQuery(function ($) {
/**
*
* IE iframe fix z-index
*
**/
function ieIframeFix(){
$("iframe").each(function () {
@BenRichter
BenRichter / common.de.xlf
Last active May 12, 2019 18:28
Symfony Twig Translation with link
<trans-unit id="translation.id">
<source>translation.id</source>
<target>Some text <![CDATA[<a href="%link%">%link_text%</a>]]> end of sentence.</target>
</trans-unit>
@BenRichter
BenRichter / normal translation
Created August 16, 2016 12:33
Find replace old Twig translation tags with new
Find: \{% trans %\}([\w\.-]+)\{% endtrans %\}
Replace: {{ '$1'|trans }}
@BenRichter
BenRichter / openPdf.js
Created January 16, 2019 15:50
Open PDF in new Tab or Fallback to Download
openPdf () {
const pdfUrl = `${process.env.API_URL}/123/pdf`
//this.printLoading = true
fetch(pdfUrl)
.then(response => response.blob())
.then(blob => {
// open pdf on new page
const newWin = window.open(
@BenRichter
BenRichter / package.js
Created February 21, 2019 14:12
Storybook React configuration for Snapshot- and Image-Snapshot-Testing (jest, webpack3)
"scripts": {
"test": "TESTING=true node scripts/test.js --env=jsdom",
"test:image": "IMG=true node scripts/test.js --env=jsdom",
"storybook": "TESTING=true start-storybook -p 6006 -c config/storybook",
},