Skip to content

Instantly share code, notes, and snippets.

@iamniels
iamniels / index.html
Created July 21, 2020 13:42
Inbound logistics - landscape phone test
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://bootswatch.com/4/darkly/bootstrap.min.css" crossorigin="anonymous">
<script src="https://unpkg.com/feather-icons"></script>
@iamniels
iamniels / send_kiyoh_invite.php
Created October 31, 2019 10:16
PHP snippet to send review invite using the Kiyoh API
<?php
$url = 'https://kiyoh.com/v1/invite/external';
$params = array(
'hash' => 'HASH',
'location_id' => 'LOCATION_ID',
'tenantId' => '98', // 99 for klantenvertellen
'delay' => 0,
'first_name' => 'CUSTOMER NAME', // Last name is optional, so just use first_name for the full name
'ref_code' => 'YOUR REFERENCE',
'language' => 'nl',
@iamniels
iamniels / openocd_output
Created December 11, 2016 23:02
OpenOCD startup
Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
@iamniels
iamniels / Server side printing with Google Cloud Print API from a PHP application.md
Created April 15, 2016 09:59
Server side printing with Google Cloud Print API from a PHP application

Server side printing with Google Cloud Print API from a PHP application

It took me quite some time to figure out how to print properly from a web application. I will explain here how I did it, so you don't have to spend the same time.

Authorization

Google Cloud Print API uses OAuth 2.0 for authorization.

As explained [here][1] on the Google Developer page, the best way to use OAuth with the Google API is with a Google service account. Create a service account as explained on the Google Developer page.

To use OAuth a library is required. Google has published the [Google API PHP client library][2]. If you want to use the examples from the Developer pages, you need to use version 1 of the library. In this article I use version 2 of the library.