Skip to content

Instantly share code, notes, and snippets.

View mcbrwr's full-sized avatar

Matthijs Brouwer mcbrwr

View GitHub Profile
@daankauwenberg
daankauwenberg / App.js
Created February 25, 2020 12:04
A React cookie consent using hooks and context
import React from 'react';
import { CookieConsentProvider } from './CookieConsent'
import Page from './Page'
function App() {
return (
<CookieConsentProvider>
<div className="App">
<Page />
</div>

Why we can't have nice things…

Missing open-source vat rules

Selling stuff on the web is not that hard anymore. Services like Stripe or Paymill make it very easy to integrate credit card payments and even getting started with Paypal is only half-horrible. But the real pain in the ass is collecting VAT correctly — at least when you are a company located in Germany (and probably most other European countries) There are simply too many rules to be considered when you send a client an invoice. For a small business with a couple invoices per year it's not a big deal. You just ask your tax advisor for any invoice that is not 100% clear. But if you want to sell software worldwide for example you simply have to find someone who does the hard VAT work for you. I went for Fastspring to handle sales for me for Kirby just because they also handle VAT collection.

The solution would be an open-source collection of VAT rules th

@bastianallgeier
bastianallgeier / routes.php
Last active July 27, 2017 19:04
Sample route setup for Kirby 2
<?php
c::set('routes', array(
array(
'pattern' => 'projects/old-project-url-for-project-a',
'action' => function() {
go('projects/project-a');
}
),
array(
@bastianallgeier
bastianallgeier / kirby2.md
Last active August 17, 2020 08:57
An overview of changes and new features for Kirby 2 – Toolkit, CMS and Panel (work in progress)

I've moved this doc to:

@mcbrwr
mcbrwr / fallback_svg_to_png.coffee
Last active August 29, 2015 13:56
Replace SVG in all image sources with PNG for browsers that don't support it.
# replace "svg" in all image src's with png for browser without svg support
checkA = document.implementation?.hasFeature "http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"
checkB = document.implementation?.hasFeature "http://www.w3.org/TR/SVG11/feature#Shape", "1.0"
if not checkA and not checkB
for image in document.images
image.src = image.src.replace(/\.svg/i, '.png')
@fitzage
fitzage / lastnotfuture.php
Created April 11, 2013 21:16
Kirby plugin to pull a specified number of posts either from a specific category, tag, or just in general that are the latest ones excluding any posts that are in the future. The date format is set for my blog post date format, but you can modify it to fit your needs. Use either a 'category' or 'tag' option to specify a category or tag, and use …
<?
function latestnotfuture($articles, $options=array()) {
global $site;
$defaults = array(
'category' => '',
'num' => '1',
'dateformat' => 'Y-m-d H:i',
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@jayj
jayj / flexbox.less
Last active June 23, 2024 01:14
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox
@nicoleslaw
nicoleslaw / 1_Tiny_Content_Framework.md
Last active June 14, 2024 17:42
Tiny Content Framework

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email (nicole@nicolefenton.com).

Contents