Skip to content

Instantly share code, notes, and snippets.

@Vinze
Vinze / calendar.php
Last active October 17, 2023 19:29
Create an HTML calendar with PHP and Carbon
<?php
// Make sure Carbon is available
function renderCalendar($dt) {
// Make sure to start at the beginnen of the month
$dt->startOfMonth();
// Set the headings (weeknumber + weekdays)
$headings = ['Weeknumber', 'Mondag', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saterday', 'Sunday'];
@Vinze
Vinze / fetch.js
Last active August 29, 2015 14:25
Resource loader ($.when wrapper)
function fetch(urls, callback) {
var requests = [];
var data = [];
for (var i = 0; i < urls.length; i++) {
requests.push($.get(urls[i]));
}
$.when.apply($, requests).then(function() {
if (typeof arguments[0] === 'object') {
@Vinze
Vinze / obj-validator.js
Created May 1, 2014 19:15
Laravel like object validation module for Node.js
var validator = require('validator');
var validates = true;
var errors = [];
module.exports = function(input, validation, cb) {
// Loop through the validation rules
for (var field in validation) {
// Get the validation rules
var rules = validation[field].split('|');
@Vinze
Vinze / nl.json
Created March 1, 2014 20:51
Popcorn Time Dutch translation
{
"beforeQuit": "Weet je zeker dat je wilt afsluiten?",
"loading": "Een ogenblik geduld...",
"loadingVideo": "Video wordt geladen, een ogenblik geduld",
"searchLoading": "Zoeken...",
"noResults": "Er zijn geen resultaten gevonden voor deze zoekopdracht.",
"search": "Zoeken",
"movies": "Films",
@Vinze
Vinze / Grid.css
Last active August 29, 2015 13:55
Responsive grid test
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row:after {
content: "";
display: table;
clear: both;