Skip to content

Instantly share code, notes, and snippets.

Avatar

Piotr Zurek pzurek

View GitHub Profile
@pzurek
pzurek / sale.json
Created Jun 2, 2016
Vend sale payload explanation
View sale.json
{
"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
View dd_payload.json
{
"series": [
{
"metric": "zendesk.unassigned",
"points": [
[
"2016-05-03T23:55:24.199142866Z",
28
]
]
View tidio_intro.md

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 Jan 29, 2015
Get token function
View getToken.js
// 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 Aug 29, 2015
Chocolate coconut turds
View choconut.md

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

View keybase.md

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 Dec 23, 2015
Pointers in Go. Short tale of asterisk and ampersand.
View pointers.go
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 Apr 3, 2021
Twelve Go Best Practices
View Twelve_Go_Best_Practices.md
View HttpClientTest.cs
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 Dec 19, 2015
A little script that disables bluetooth when the power cable is disconnected and enables it back when plugged in
View BTbyPower.applescript
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