Skip to content

Instantly share code, notes, and snippets.

@oheyandy
oheyandy / conditional.html
Created April 16, 2014 18:37
Display fields in Desk.com case theme depending on whether or not a label is present
<!--
In this example assume we have some cases which are creatd with the a label called "Display Custom Field"
And ONLY when this label is present on a case we want to display a Case Custom Field on teh case theme called "Awesome List"
You would use the following (walkthrough of the logic below):
-->
<!--=======-->
<!--Snippet-->
@DeskWOW
DeskWOW / gist:7338514
Last active December 27, 2015 14:09
Below is the JavaScript code for real-time article suggest in your Desk.com support center contact form. This is to be placed within your theme's "Email (New)" section of Advanced Themes within Desk.com Admin.
<div id="autosuggest" style="display: none;"></div>
<div id="common">
<h4>Common Questions</h4>
<p>This will show on page-load and if no results are found based on what the user is typing. You can optionally put links to common articles here.</p>
</div>
<script>
var as_count = 0;
$(function() {
@pamelafox
pamelafox / desk.py
Created June 25, 2013 02:09
Desk.com API Python Wrapper
import logging
import requests
from django.utils import simplejson
from django.conf import settings
class DeskError(Exception):
def __init__(self, status):
Exception.__init__(self, status) # Exception is an old-school class
@dmatt
dmatt / PygLatin.py
Last active December 17, 2015 04:09
Code Academy - Pyg Latin Translator
pyg = 'ay'
print "Welcome to the Pyg Latin Translator"
original = raw_input('Enter a word to be translated:')
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first in ["a","e","i","o","u"]:
new_word = word+pyg
@endolith
endolith / export_google_starred_locations.py
Created October 16, 2012 02:29
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""