Skip to content

Instantly share code, notes, and snippets.

@hlombroso
hlombroso / git-deployment.md
Created October 1, 2019 14:56 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@hlombroso
hlombroso / README.md
Created May 19, 2019 13:01
HTML to PDF conversion in PHP using wkhtmltopdf (and optionally Smarty)

Recently I was asked to generate PDF invoices for an online shop. I looked at various PHP PDF generators, but wasn't particularly impressed with any of them.

Then I found (via Stack Overflow) a command-line HTML-to-PDF convertor called wkhtmltopdf, which uses WebKit (the same layout engine as Safari and Google Chrome) and therefore is very accurate.

There is a class for PHP integration on the Wiki, but I found it overly complicated and it uses temp files which aren't necessary. This is the code I wrote instead.

I used Smarty for generating the HTML for the PDF, but you can use any template engine, or pure PHP if you prefer.

Note: I originally tried to install wkhtmltopdf from source, but it's much easier to use the static binary instead.

@hlombroso
hlombroso / paper.py
Created April 1, 2018 09:34
guide to download video courses from safaribooks.freepaper.me
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,