Skip to content

Instantly share code, notes, and snippets.

View wladan's full-sized avatar

Vladan wladan

  • Freelance
  • Belgrade, Serbia
View GitHub Profile
@moderatorwes
moderatorwes / zendesk.html
Created November 9, 2016 16:34
Zendesk: Redirect Category Links using {{curlybars}}
<!-- Grab the id of the category and insert into the is statement. This code is from the Copenhagen Theme-->
<li class="blocks-item">
{{#is id 204259447}}
<a href="/hc/communities/public/topics" class="blocks-item-link">
<h4 class="blocks-item-title">{{name}}</h4>
<p class="blocks-item-description">{{excerpt description}}</p>
</a>
{{else}}
<a href='{{url}}' class="blocks-item-link">
<h4 class="blocks-item-title">{{name}}</h4>
@moderatorwes
moderatorwes / article.html
Created April 12, 2016 13:39
Zendesk: Formatting Tags
<ul class="tags">
Tags: {{#each article.labels}}
<li class="tag">{{identifier}}<li>
{{/each}}
</ul>
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@makeusabrew
makeusabrew / label-to-placeholder.js
Created May 22, 2011 18:32
Simple jQuery snippet to convert form labels into inline placeholders
$("form :input").each(function(index, elem) {
var eId = $(elem).attr("id");
var label = null;
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) {
$(elem).attr("placeholder", $(label).html());
$(label).remove();
}
});