Skip to content

Instantly share code, notes, and snippets.

View pzurek's full-sized avatar

Piotr Zurek pzurek

View GitHub Profile
@pzurek
pzurek / Twelve_Go_Best_Practices.md
Last active March 16, 2024 14:19
Twelve Go Best Practices
@pzurek
pzurek / Command.fs
Created September 11, 2012 23:24
A quick F# example for Revit
namespace FSharpPanelBuilder
open System
open System.Collections.Generic
open Autodesk.Revit
open Autodesk.Revit.UI
open Autodesk.Revit.Attributes
open Autodesk.Revit.DB
open Autodesk.Revit.UI.Selection
@pzurek
pzurek / FilterPerformance.cs
Created January 10, 2011 03:16
Revit 2011 filter performance testing
//
// Compare TypeFilter versus using an
// anonymous method to filter elements.
// By Guy Robinson, info@r-e-d.co.nz.
//
// Copyright (C) 2008 by Jeremy Tammik,
// Autodesk Inc. All rights reserved.
//
// Updated to the Revit 2011 API and added LINQ filtering.
// Changed the anonymous method to a lambda expression.
@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
]
]
@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 / 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
@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

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