Skip to content

Instantly share code, notes, and snippets.

@skipjac
skipjac / amy.js
Last active August 29, 2015 14:20
build to functions to run in a loop with the options you want to show and hide
//make a function to hide options as they are passed into it.
var skip1 = function(k){
$('.nesty-panel').on('DOMNodeInserted', function(e){
$(this).children('ul').children(k).hide();
});
}
// call the function with the option value with a # in front
skip1('#sss_a_1')
//make a function to show the option
@naoyamakino
naoyamakino / railsConfShopifyScaling.md
Created May 2, 2013 20:31
How Shopify Scales Rails via @johnduff #railsConf

How Shopify Scales Rails John Duff

The Stack:

  • ruby1.9.3-p327
  • rails3.2
  • unicorn 4.5
  • percona Mysql5.5
  • memcache14.14
  • redis2.6

33 app servers, 1172 unicorn workers, 5 job servers, 370 job workers

@jbdietrich
jbdietrich / python_flask_jwt.py
Last active December 8, 2019 18:58
A naive implementation of Zendesk's JWT-based Remote Auth for Flask
# This example relies on you having installed PyJWT, `sudo easy_install PyJWT` - you can
# read more about this in the GitHub repository https://github.com/progrium/pyjwt
from flask import Flask, request, redirect
import time
import uuid
import jwt
# insert token here
app.config['SHARED_KEY'] = ''
@skipjac
skipjac / zendeskrequire.js
Last active December 16, 2015 07:38
use to make sure all the fields in zendesk are available
//place these right after return
currAttempt : 0,
MAX_ATTEMPTS : 20,
events: {
'requiredProperties.ready': 'whatever'
}
//
init: function() {
@fdittrich
fdittrich / gist:4654533
Created January 28, 2013 10:41
Changing link text "Finding someone to chant with" to something else. The code ve
1. In feedback tab settings open advanced customizations
2. Change line 9 to the new text you want to show instead of the default text
3. paste the code below into the "Custom CSS" field
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript">
setTimeout(function(){
$("a.preferChat span").html("New text here");
}, 200);
@grampelberg
grampelberg / gist:4601476
Created January 23, 2013 02:59
No more proxy for me zendesk!
(function() {
var scope = {};
with(scope) {
return {
events: {
'app.activated':'doSomething',
'click header': 'check'
@jamesarosen
jamesarosen / iteration.js
Created August 28, 2012 22:43
JavaScript fundamentals
// Array Iteration:
myArray = [ 'foo' ];
myArray.forEach(function(x) { console.log(x); });
// prints "foo"
// Object Keys:
myObject = { foo: 'bar', baz: 'quux' };
Object.keys(myObject); // [ "foo", "baz" ]
// Object Iteration Helper (context is optional)
@osheroff
osheroff / zd_proxy_post.js
Created June 29, 2011 18:21
zendesk proxy -- post
$j.ajax(
{
type: 'POST',
url: '/proxy/direct',
data:
{
url: "http://www.outbound.com",
body: $j.param({a: "bar", b: "buz"}),
contenttype: "application/x-www-form-urlencoded"
}
@markgukov
markgukov / Installing Node on AWS Linux AMI
Created March 31, 2011 18:37
Here are the steps to install node, npm and express on Amazon 32 bit Linux AMI
Here are the steps to install node, npm and express on Amazon 32 bit Linux AMI:
sudo yum install gcc-c++
sudo yum install openssl-devel
wget http://nodejs.org/dist/node-v0.4.2.tar.gz (Pick the stable version available)
tar -zxvf node-v0.4.2.tar.gz
cd node-v0.4.2
export JOBS=2
./configure
make
// The following goes in a Javascript widget:
(function() {
// fetch parameters from the URL:
var queryParameters = jQuery.queryParameters();
// set field values:
jQuery('#some_field_id').val(queryParameters['field_name']);
})();