Skip to content

Instantly share code, notes, and snippets.

View Daniel-Wiedemann's full-sized avatar

MEDIATRASH Daniel-Wiedemann

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
@Daniel-Wiedemann
Daniel-Wiedemann / trimDoubleChars.js
Created September 24, 2015 19:32
Remove double Charaters (Beware of the spaces!!!)
function removeDoubleChars(){
var input = document.getElementById('inputText').value,
output = document.getElementById('outputText'),
chars = [];
for(var i = 0; i < input.length; i++){
if(chars.indexOf(input[i]) === -1) chars.push(input[i]);
}
chars.sort();
output.value = chars.join('');
};
@Daniel-Wiedemann
Daniel-Wiedemann / speed_up_browserSync_watch.js
Created August 19, 2016 07:59
Speed up browserSync with watcher after SASS compiling
// If the browserreload with browserSync and watch after SASS compiling is to slow,
// following solutions could help.
// Use one or more of the following options
// Options:
// spawn: false
// interrupt: true
// persistent: true
// interval: 5007
grunt.initConfig({
@Daniel-Wiedemann
Daniel-Wiedemann / pad
Created August 14, 2018 09:27
Pad a number with leading zero in JavaScript
module.exports.pad = (paramNumber) => {
paramNumber < 10 && paramNumber > -1 ? '0' + paramNumber : paramNumber;
};