Skip to content

Instantly share code, notes, and snippets.

View vandernoud's full-sized avatar

Arnoud van der Velden vandernoud

  • Blue Mango Interactive
  • Eindhoven, the Netherlands
View GitHub Profile
setYearInFooter = function() {
var date = new Date();
var year = date.getFullYear();
var footerCopyright = document.querySelector('.footer__copyright');
footerCopyright.innerHTML = ('© ' + year + '- Vodafone Libertel B.V.');
};
@vandernoud
vandernoud / creating-appending.js
Last active November 9, 2015 15:25
Creating and appending with javascript
// Test variant 1
var bestelButton = document.getElementById('ID').getElementsByClassName('CLASS')[0];
var bestelBlock = document.createElement('p');
var bestelText = document.createTextNode('TEXT');
bestelBlock.appendChild(bestelText);
bestelButton.appendChild(bestelBlock);
// Test variant 2
var bestelButton = document.getElementById('ID');
@vandernoud
vandernoud / performance-check.js
Last active October 28, 2015 13:48
Concept for performance specific components
// Parsed user agent
var userAgent = UAParser(navigator.useragent);
// Browser info
var browserName = userAgent.browser.name;
var browserVersion = userAgent.browser.major;
// OS info
var osName = userAgent.os.name;
var osVersion = userAgent.os.version;
@vandernoud
vandernoud / gist:d4bb9b8bb7d338dc220f
Last active October 1, 2015 13:06
Breakpoint script
.block {
background: black;
width: 500px;
height: 100px;
margin: 0 auto;
text-align: center;
&:before {
margin-top: 25px;
display: inline-block;
background: white;
var getLastDayOfMonth = function(){
var date = new Date();
var lastDay = new Array([]);
lastDay[0] = "31 januari";
lastDay[1] = "28 februari";
lastDay[2] = "31 maart";
lastDay[3] = "30 april";
lastDay[4] = "31 mei";
lastDay[5] = "30 juni";
lastDay[6] = "31 juli";
browser-sync start --server --files "*.html, css/*.css"
@vandernoud
vandernoud / Timer script
Last active August 29, 2015 14:23
Timer script
var today = new Date();
// Month is zero based so April is 3
if (today.getHours() >= 0 && today.getDate() >= 29 && today.getMonth() >= 5 && today.getFullYear() >= 2015) {
function getUrlVar(key) {
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}
if (getUrlVar('showsite') != 'true') {
window.location = 'https://site.nl';
$('body').append('<img src="'+pixel+'" height="1" width="1" />');
// For PNG dropshadows
.shadow {
filter: drop-shadow(10px 10px 3px rgba(0,0,0,1));
-webkit-filter: drop-shadow(10px 10px 3px rgba(0,0,0,1));
}