Skip to content

Instantly share code, notes, and snippets.

View chaseroden's full-sized avatar

Chase Roden chaseroden

View GitHub Profile
@armstrjare
armstrjare / Notify-requester-of-comment-update.liquid
Last active March 7, 2019 20:55
Zendesk Regular Email Formatting
{% capture newline %}
{% endcapture %}{% capture htmlemail %}{{ ticket.latest_comment_formatted | split:"<table" | size }}{% endcapture %}{% if htmlemail == '1' %}{{ ticket.latest_comment.value }}
{% else %}{{ ticket.latest_comment.formatted_value }}{% endif %}
{% for attachment in ticket.latest_comment.attachments %}
Attachment: {{attachment.filename}} {{attachment.url}}
{% endfor %}
{% if htmlemail == '1' %}
{% for comment in ticket.public_comments %}{% if forloop.index > 1 %}{% capture preline_prefix %}
{% for i in (3..forloop.index) %}>{% endfor %}{% if forloop.index > 2%} {% endif %}{% endcapture %}{{ preline_prefix }}On {{ comment.created_at_with_time | date:'%a, %B %-d, %Y at %-I:%M %p' }}, {{ comment.author.name }} <{{ comment.author.email }}> wrote:{{ preline_prefix }}{% capture line_prefix %}
{% for i in (2..forloop.index) %}>{% endfor %} {% endcapture %}{{ line_prefix }}{{ comment.value | split:newline | join:line_prefix }}{{ line_prefix }}{% endif %}{% endfor %}
@Pyrolistical
Pyrolistical / functions.js
Last active December 28, 2017 04:10 — forked from RedBeard0531/functions.js
Mongo map reduce functions to calculate sum, min, max, count, average, population variance, sample variance, population standard deviation, sample standard deviation Public Domain License
function map() {
emit(1, {
sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count: 1,
diff: 0
});
}
@stefanschmidt
stefanschmidt / remove-annotations.sh
Last active February 1, 2024 17:01
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress
@czerasz
czerasz / varnish-jsonp.vcl
Last active November 1, 2016 20:33 — forked from simonw/varnish-jsonp.vcl
Get Varnish to handle JSONP requests - working example
backend jsonp_varnish {
.host = "localhost";
.port = "80";
}
#------------- begin jsonp functionality -------------#
# How the jsonp_template_backend dispatches to the ESI generating code:
sub jsonp_throw_error_recv {
if (req.url == "/JSONP-ESI-TEMPLATE") {
error 760;
@WillAbides
WillAbides / index.html
Created December 9, 2012 17:37
firstgist
hello world
@turtlesoupy
turtlesoupy / nginx.conf
Created July 8, 2012 21:16
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@nautilebleu
nautilebleu / gist:722377
Created November 30, 2010 20:51
How to capture patterns in glob style with Python 2.7 argparse
#!/usr/local/bin/python2.7
# coding=utf-8
import argparse
import pprint
from glob import glob
def main():
parser = argparse.ArgumentParser(description='Get some files according to a pattern')
parser.add_argument('pattern', type=file, action='store', nargs='+')
args = parser.parse_args()