Skip to content

Instantly share code, notes, and snippets.

View pzurek's full-sized avatar

Piotr Zurek pzurek

View GitHub Profile
@pzurek
pzurek / gist:3909011
Created October 17, 2012 23:33
Vend API docs
If you find any errors or discrepancies please notify __developer@vendhq.com__. Also if you have any brilliant ideas on how we can make it better, let us know. __:)__
Also, __don’t be evil__.
# Introduction
The Vend API is implemented as JSON over HTTPS using the verbs GET, PUT, POST and DELETE.
## Authentication
Authentication is managed using HTTP authentication (only "Basic" is supported right now). Every request must include the Authorization HTTP header. Use the properties username and password to authenticate. Example with Curl:
@pzurek
pzurek / purge_unnamed_ref_planes.rb
Last active December 17, 2015 04:39
A simple Revit macro written in Ruby. Upon execution it detects and deletes all unnamed reference planes.
load_assembly "RevitAPI"
load_assembly "RevitAPIUI"
include Autodesk::Revit::DB
include Autodesk::Revit::UI
include Autodesk::Revit::UI::Selection
include System::Collections::Generic
include System::Collections
include System
@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
@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 / Twelve_Go_Best_Practices.md
Last active March 16, 2024 14:19
Twelve Go Best Practices
@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

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 / 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

@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

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