Skip to content

Instantly share code, notes, and snippets.

:atom:
ALL YOUR BASE ARE BELONG TO US

Jorijn Jacko Smit jorijnsmit

:atom:
ALL YOUR BASE ARE BELONG TO US
Block or report user

Report or block jorijnsmit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jorijnsmit
jorijnsmit / flatten.py
Created Dec 30, 2018
Flatten Python lists and tuples into their individual items
View flatten.py
def flatten(li):
"""Flatten lists or tuples into their individual items. If those items are
again lists or tuples, flatten those."""
if isinstance(li, (list, tuple)):
for item in li:
yield from flatten(item)
else:
yield li
@jorijnsmit
jorijnsmit / print-delivery-note.php
Created Apr 29, 2013
Custom invoice template which complies to all Dutch tax regulations (Belastingdienst). Both files are placed in wp-content/themes/<yourtheme>/woocommerce/print/.
View print-delivery-note.php
<!DOCTYPE html>
<html lang="<?php echo WPLANG; ?>" class="<?php echo wcdn_get_template_type(); ?>">
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="<?php wcdn_stylesheet_url( 'style.css' ); ?>" type="text/css" media="screen,print" />
</head>
<body>
<div id="container">
<div id="content">
View style.css
body {
font-family: Courier;
font-size: 11pt;
}
#page {
margin-left: auto;
margin-right: auto;
padding-top: 5%;
padding-bottom: 5%;
padding-left: 10%;
View print-delivery-note.php
<!DOCTYPE html>
<html lang="<?php echo WPLANG; ?>" class="<?php echo wcdn_get_template_type(); ?>">
<head>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="<?php wcdn_stylesheet_url( 'style.css' ); ?>" type="text/css" media="screen,print" />
</head>
<body>
<div id="container">
<div id="content">
You can’t perform that action at this time.