Skip to content

Instantly share code, notes, and snippets.

View pzurek's full-sized avatar

Piotr Zurek pzurek

View GitHub Profile
@pzurek
pzurek / sale.json
Created June 2, 2016 18:26
Vend sale payload explanation
{
"register_id": "b1e198a9-f019-11e3-a0f5-b8ca3a64f8f4", // register to assign the sale to
"customer_id": "06e35f89-3783-11e6-ec7e-13193f7bd2ed", // [optional] customer associated with the sale
"user_id": "b1ed6158-f019-11e3-a0f5-b8ca3a64f8f4", // Vend user associated with the sale
"sale_date": "2016-05-05 23:35:34", // [optional] by default current time will be assigned
"note": "", // [optional] a note to be attached to the sale
"status": "CLOSED", // One of: SAVED, CLOSED, ON_ACCOUNT, LAYBY, ON_ACCOUNT_CLOSED, LAYBY_CLOSED
"short_code": "mlzs94", // [optional] used for loyalty claiming
"invoice_number": "MR-1484-NZ", // [optional] invoice number, if omitted one will be assigned by
{
"series": [
{
"metric": "zendesk.unassigned",
"points": [
[
"2016-05-03T23:55:24.199142866Z",
28
]
]

Introduction

This module should include three main elements that will allow for a full integration of Tidio Chat with a website based on typo3.

These elements are:

  1. Sending a request and saving a pair of the keys to the database
  2. Adding a new position in the admin menu
  3. Adding a script to the page content

Send request and save a pair of database keys

@pzurek
pzurek / getToken.js
Created January 29, 2015 04:40
Get token function
// This function exchanges the authorization code for a token and returns the parsed info
function getToken(myCode, myDomainPrefix) {
var tokenUrl = "https://" + myDomainPrefix + ".vendhq.com/api/1.0/token";
var payload = {
"code": myCode,
"client_id": myVendClientId,
"client_secret": myVendClientSecret,
"grant_type": "authorization_code",
"redirect_uri": myVendRedirectUri
@pzurek
pzurek / choconut.md
Last active August 29, 2015 14:06
Chocolate coconut turds

Ingredients:

  • Whittakers 72% Cocoa Dark Ghana Chocolate 250g
  • Condensed Milk ~800g (2 cans of Nestle Condensed Milk @ 395g)
  • Finely groud coconut 500g
  • Almonds ~150g - can be ground, sliced, or slivered - whatever floats your boat
  • Vanilla Extract 1 tsp.
  • Love

Keybase proof

I hereby claim:

  • I am pzurek on github.
  • I am pzurek (https://keybase.io/pzurek) on keybase.
  • I have a public key whose fingerprint is 1757 F1FF 0068 4C51 738C CB34 B4C3 0087 2944 31CD

To claim this, I am signing this object:

@pzurek
pzurek / pointers.go
Last active December 23, 2015 14:09
Pointers in Go. Short tale of asterisk and ampersand.
package main
import "fmt"
func main() {
var a int
var b int
var c *int
a = 42
@pzurek
pzurek / Twelve_Go_Best_Practices.md
Last active March 16, 2024 14:19
Twelve Go Best Practices
@pzurek
pzurek / HttpClientTest.cs
Created August 8, 2013 08:50
Fails on Mono...
using System;
using System.Net.Http;
namespace VendTest
{
class MainClass
{
public static void Main(string[] args)
{
Client client = new Client();
@pzurek
pzurek / BTbyPower.applescript
Last active December 19, 2015 08:29
A little script that disables bluetooth when the power cable is disconnected and enables it back when plugged in
on idle
set powerStatus to do shell script "pmset -g ps"
tell application "System Preferences"
reveal pane id "com.apple.preferences.Bluetooth"
#activate
tell application "System Events" to tell process "System Preferences"
set btCheckBox to checkbox "On" of window 1
if powerStatus contains "Battery Power" then
tell btCheckBox