Skip to content

Instantly share code, notes, and snippets.

View matkl's full-sized avatar

Matthias matkl

  • Germany
View GitHub Profile
@matkl
matkl / firstDayOfMonth.js
Created July 20, 2016 03:06
Get first day of month in JavaScript
export default function getFirstDateOfMonth() {
const now = new Date();
return new Date(now.getFullYear(), now.getMonth());
}
@matkl
matkl / gist:413db1a282f5622607c8c4e08fca3673
Created July 2, 2016 00:07
Delete ALL node_modules recursively
npm install -g rimraf
find . -name "node_modules" -exec rimraf {} \;
@matkl
matkl / colors.styl
Created October 2, 2015 20:36
Material Design Colors for Stylus
md-red-50 = #ffebee
md-red-100 = #ffcdd2
md-red-200 = #ef9a9a
md-red-300 = #e57373
md-red-400 = #ef5350
md-red-500 = #f44336
md-red-600 = #e53935
md-red-700 = #d32f2f
md-red-800 = #c62828
md-red-900 = #b71c1c
@matkl
matkl / animate.js
Last active August 29, 2015 14:05
Cross browser animate function for animate.css - Vanilla JavaScript. IE10+
function animate(element, animation) {
var eventNames = [
'animationend',
'webkitAnimationEnd',
'MSAnimationEnd',
'oAnimationEnd'
];
var listeners = [];
element.classList.add('animated');
@matkl
matkl / lightbox.css
Created January 10, 2014 00:22
Lightbox for IE9+, Chrome, Firefox.
.lightbox {
background: rgba(0,0,0,0.85);
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
}
@matkl
matkl / app.js
Created February 26, 2013 05:17
A requirejs template using socket.io and knockout.js
requirejs.config({
paths: {
'socket.io': '/socket.io/socket.io',
'knockout': 'http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.0/knockout-min'
},
shim: {
'socket.io': {
exports: 'io'
}
}