Skip to content

Instantly share code, notes, and snippets.

View dpawluk's full-sized avatar

Daniel Pawluk dpawluk

  • Zendesk
  • Wisconsin
View GitHub Profile
@dpawluk
dpawluk / iframe.html
Created August 8, 2020 01:19
Get all users on app start, async promise based
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- See Using Zendesk Garden:
https://developer.zendesk.com/apps/docs/developer-guide/setup#using-zendesk-garden
https://garden.zendesk.com/css-components/bedrock/
https://garden.zendesk.com/css-components/utilities/typography/
-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/npm/@zendeskgarden/css-bedrock@7.0.21,npm/@zendeskgarden/css-utilities@4.3.0">
@dpawluk
dpawluk / vs_backup_restore.sh
Created February 24, 2023 02:06
A possibly unworking attempt at writing a bash script to automatically delete your steam deck Vampire Survivor save files after backing them up (this works) and a shitty restore function (untested).
#! /usr/bin/bash
# the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# the temp directory used, within $DIR
# omit the -p parameter to create a temporal directory in the default location
WORK_DIR=`mktemp -d -p "$DIR"`
# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
@dpawluk
dpawluk / do_the_things_v1.js
Created December 6, 2016 20:41
Get PDF from URL, create Object URL, then download/open in a browser window
(function() {
return {
events: {
'app.activated':'init'
},
init: function() {
var self = this;
@dpawluk
dpawluk / modal.html
Created February 17, 2017 20:28
Establishing a modal instance and communicating with it from the parent instance
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous">
</script>
</head>
@dpawluk
dpawluk / ticket_get_user.js
Created December 28, 2016 19:48
Get user data using the ticket.requester while in the ticket_sidebar location
<html>
<head>
<style type="text/css">
h2 {
border: 5px solid #efefef;
border-radius: 4px;
padding: 5px;
font-size: 100%;
text-align: center;
margin-bottom: 30px;
@dpawluk
dpawluk / modal.html
Created May 12, 2017 19:50
shows how to access the parent client easily from a modal iframe.
<html>
<head>
<meta charset="utf-8">
<!-- http://garden.zendesk.com -->
<link rel="stylesheet" href="https://assets.zendesk.com/apps/sdk-assets/css/0/zendesk_garden.css" type="text/css">
</head>
<body>
<h2 class="u-gamma">Hello, World!</h2>
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
<script type="text/javascript" src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js"></script>
@dpawluk
dpawluk / googAppEng_zdphp.php
Created September 29, 2014 16:57
Use PHP and file_get_contents to make a PUT request in a Google AppEngine Environment
<?php
$email = 'SOME_USERNAME';
$token = 'API_TOKEN';
$domain = 'ROOT_URL'; //e.g. 'https://z3ndocs.zendesk.com';
$ticket_id = 0000; // int, not string
$auth_string = $email . '/token:' . $token;
$enc_auth = base64_encode($auth_string);
@dpawluk
dpawluk / chat_stats_by_month.py
Last active June 18, 2020 09:25
Get chat output by month from Zopim API
import requests
import json
from itertools import zip_longest
import pandas as pd
import numpy as np
config = {
'username': 'EMAILGOESHERE',
'password': 'PASSWORDGOESHERE',
'base_path': 'https://www.zopim.com/api/v2'
@dpawluk
dpawluk / keybase.md
Last active December 10, 2019 21:01
keybase.md

Keybase proof

I hereby claim:

  • I am dpawluk on github.
  • I am dpawluk (https://keybase.io/dpawluk) on keybase.
  • I have a public key whose fingerprint is 6367 FC00 A1A8 090D 3148 6631 86AF 9BE4 F608 790A

To claim this, I am signing this object:

@dpawluk
dpawluk / iframe.html
Created January 2, 2017 21:06
Simple function to emulate v1 template switching using external hbs templates in the assets folder. Note: cdns used to acquire some common libraries.
<html>
<body>
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
<script
type="text/javascript"
src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js" >
</script>
<script
type="text/javascript"