Skip to content

Instantly share code, notes, and snippets.

@skipjac
skipjac / gist:8783de387d23bf171645
Created April 3, 2015 15:46
Remove Ticket Form option from dropdown in Zendesk
//remove the options from the select
$('#request_issue_type_select option[value="43517"]').remove();
//remove the option from the nesty-input after it's been created.
$('div').one('DOMNodeInserted', function(e){
$('.nesty-panel').one('DOMNodeInserted', function(e){
$(this).children('ul').children().remove('#43517');
});
});
@skipjac
skipjac / file-upload.php
Created July 14, 2011 00:25
Upload file to zendesk with PHP
<?php
$url = "http://skipjack.zendesk.com/uploads.xml?filename=dropbox1.html";
$file = fopen("dropbox1.html", "r");
$size = filesize($file);
$header= array('Content-type: application/binary' );
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, "skip@youremail.net:passwrod");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST ,1);
@skipjac
skipjac / getBlog.js
Created April 17, 2014 18:26
A RSS reader for Zendesk HelpCenter
<script>
console.log($('#one').contents());
$(document).ready(function() {
truncate = function(text, length, ellipsis) {
// Set length and ellipsis to defaults if not defined
if (typeof length == 'undefined') var length = 100;
if (typeof ellipsis == 'undefined') var ellipsis = '...';

Keybase proof

I hereby claim:

  • I am skipjac on github.
  • I am skip (https://keybase.io/skip) on keybase.
  • I have a public key ASCX8kPbL_oHxuVUuWG0bqfjYKdx7YWystJ54VqnJdPHOwo

To claim this, I am signing this object:

@skipjac
skipjac / article.hbs
Created February 12, 2018 20:39
video library in Zendesk Guide
<div class="article-main" data-section-id="{{section.id}}" data-section-name="{{section.name}}">
<div id="sidebar" class="sidebar-panel">
<ul class="sidebar">
<div class="close-sidebar">←</div>
<li class="sidebar-item sidebar-home">
<a href="{{page_path 'help_center'}}" class="sidebar-item-title">
Home
</a>
</li>
<li :class="['sidebar-item', 'sidebar-section', isOpen(category.id)]"
@skipjac
skipjac / rssreader.html
Created April 29, 2013 17:53
Zendesk Classic RSS reader widget
<h4>Blog</h4>
<div id="feedContent">
</div>
<script>
$j(document).ready(function() {
truncate = function(text, length, ellipsis) {
@skipjac
skipjac / bs-parser.js
Last active April 20, 2016 20:28
For order data
var data = 'Orders[Count=1, Order [customer=Customer [id=6a665314-44ac-4fd9-af73-ed975fb19018, name=Tarik, givenname=Taaza, birthday=Wed Apr 20 05:12:19 CEST 2016, plz=50933, street=Aachener Str., house=746-750, city=Köln], name=Installation, note=not ready, created=Wed Apr 20 05:12:19 CEST 2016, status=not ready]]'
function ordersJSONize(str) {
return str
//right bracket replacement
.replace(/]/g,'}')
//left bracket replacement
.replace(/\[/g,'{')
// equal sign replacement
.replace(/\b=|!(\s=)/g,':')
@skipjac
skipjac / helpcenterUser.js
Last active January 23, 2016 15:29
This is the Zendesk HelpCenter.user javascript object that can be called from any javascript code in HelpCenter
Object {identifier: "sss", email: "skip@zen.com", name: "Skip Moore", tags: Array[2], locale: "en-us"}
avatar_url: "https://z3nofskip.zendesk.com//system/photos/6753/8923/200px-Skippy-dvd.jpg"
email: "skip@zendesk.com"
groups: Array[4]
0: Object
default: false
isActive: true
name: "Support"
__proto__: Object
1: Object
@skipjac
skipjac / global.css
Created November 25, 2014 00:36
Changing the size of HelpCenter nesty fields.
.nesty-input {
max-width: 555px;
}
@skipjac
skipjac / eventListner.js
Created January 15, 2014 06:07
idea for watching the DOM in Helpcenter
var target = document.querySelector('.nesty-panel');
target.addEventListener ("DOMSubtreeModified", function(){
_.defer(function(){ console.log($('[name="request[custom_fields][21305759]"]').val())});
})