Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Nurbo andreasnrb

View GitHub Profile
@andreasnrb
andreasnrb / uk-vat-id-validation.php
Last active Jan 22, 2021
Code snippet to validate UK VAT IDs with Barns2uks EDD EU VAT plugin. Requires https://vatsense.com API KEY
View uk-vat-id-validation.php
<?php
//License is public domain, use to your hearts content. I take no ownership or responsibility
use Barn2\Plugin\EDD_VAT\VAT_Check_Result;
add_filter( 'edd_vat_number_check', function ($result, $vat_number, $country_code ) {
if($result->error === VAT_Check_Result::INVALID_INPUT && $country_code==='GB') {
if(strlen($vat_number)!==9 || !filter_var($vat_number, FILTER_VALIDATE_INT)) {
return $result;
}
@andreasnrb
andreasnrb / myndigheter.md
Last active Apr 26, 2016 — forked from anonymous/myndigheter.md
Lista på myndigheter jag inte förstår vitsen med
View myndigheter.md
  • Alkoholsortimentsnämnden Alkoholsortimentsnämnden är en statlig myndighet som prövar vissa beslut som fattas av Systembolaget.
  • Fideikommisnämnden
  • Forskarskattenämnden Forskarskattenämnden är en myndighet under Finansdepartementet som beslutar i det enskilda fallet om skattelättnader för utländska experter, forskare eller andra nyckelpersoner som arbetar tillfälligt i Sverige. Nämndens ledamöter utses av regeringen.
  • Konstfack
  • Konstnärsnämnden Att ge ekonomiskt stöd i form av stipendier och bidrag
  • http://www.kulturanalys.se/ Kulturanalys har regeringens uppdrag att utvärdera, analysera och redovisa effekter av förslag och genomförda åtgärder inom kulturområdet. Detta ska göras
@andreasnrb
andreasnrb / controller.php
Last active Apr 14, 2016
Options framework example. Still work in progress and changes weekly.
View controller.php
<?php
public function setup_example_page()
{
$page = new Page('sf-example-page');
$accordion = new Accordion();
$page->add($accordion);
do_action('sf-example-page', [$accordion]);
$save = new Row();
$save->add(new NonceField('save-example-settings'));
$save->add(new SaveButton());
View vision.md

My vision

Introduction

What you can do with WordPress is not the place to start, what WordPress can do for you is what is important. A tool should enable you to accomplish your goals, the tool should not restrict you, should not demand to be mangled, it should not slow you down due to form. So is that what WordPress is today? A lean, easy to use, non-restrictive power drill that helps you build your house? Or is it a tool which batteries has run dry and you end up using it as a hammer? The community has invented numerous addons to overload parts of WordPress, be it theme engines, routing, editors, admin areas. All ways to work around the shortcommings in WordPress. Various hacky solutions has been used to make WordPress load things faster when all it needs to do is print some text. The various hacky solutions is also not very easy to integrate together. They all exist in some sort of WordPress imposed isoloation.

**Our goal is to make WordPress be that lean easy to use tool it has the potential to be. R