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 / 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 / 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 / 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 / readme.md
Last active September 26, 2018 15:37
Bash script that sets a specific resource_type and relationship_type to help save time with a demo app

Instructions to use

  • please download and save the above file setup_resources.sh
  • navigate to the file's directory and perform chmod +x setup_resources.sh
  • to run enter ./setup_resources.sh and follow the prompts
@dpawluk
dpawluk / iframe.html
Created August 21, 2018 23:42
This app shows that the window.onbeforeunload() event will fire and allow (some) functions to finish executing before the window is closed.
<html>
<head>
<meta charset="utf-8">
<!-- http://garden.zendesk.com -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@zendeskgarden/css-bedrock@7.0" 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>
### Keybase proof
I hereby claim:
* I am dpawluk on github.
* I am dpawluk (https://keybase.io/dpawluk) on keybase.
* I have a public key ASDABA1mo3_9G7_6Q57goyrDepg2nU4hh8x9qe8WbscG8Ao
To claim this, I am signing this object:
@dpawluk
dpawluk / create_request.js
Last active November 29, 2017 19:30
This implies a button with id="testsub" exists to actually test running this code. It uses the ZD Help Center session to create a dummy request when the button is clicked.
$(document).ready(function() {
$('#testsub').click(function(){
$.ajax('/api/v2/users/me.json').then(function(udata){
var csrf_auth = udata.user.authenticity_token;
console.log(csrf_auth);
$.ajax({
url: "/api/v2/requests.json",
contentType: "application/json",
type: "POST",
@dpawluk
dpawluk / iframe.html
Last active November 15, 2017 18:41
Shows how ticket.save hook should be used in a v2 app. Very minimal example
<html>
<body>
<h2>Test Save Hooks</h2>
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
<button id="failMeNow">Force Fail</button>
<script type="text/javascript" src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">
@dpawluk
dpawluk / iframe.html
Created September 1, 2017 15:55
example of using app.registered to call a function.
<html>
<head>
<meta charset="utf-8">
<!-- http://garden.zendesk.com -->
<link rel="stylesheet" href="https://assets.zendesk.com/apps/sdk-assets/css/1/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 / modal_parse.html
Created June 14, 2017 19:21
Shows how a modal can parse a parent's instance uuid and then work with the parent client from the modal
<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>
<div id="content_area"></div>
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->