Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorijn Jacko Smit jorijnsmit

View GitHub Profile
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%;
@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">
@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 / reducing.py
Last active Jun 2, 2020
Reduce pd.DataFrame memory size by intelligently downgrading data types.
View reducing.py
"""reducing.py
Author: Kirgsn, 2018
Use like this:
>>> import reducing
>>> df = reducing.Reducer().reduce(df)
"""
import numpy as np
import pandas as pd
import time
You can’t perform that action at this time.