Skip to content

Instantly share code, notes, and snippets.

{
"comment": {
"video_id": 1,
"body": "xx",
"cue_point": 360
},
"auth_token": 'xxxx',
"user_email": "[email protected]"
}

Raw JSON

{\n "accountURL": "https://domain.com\",\n "newCommitsCount": "1",\n "pushURL":"https://domain.com/project/64249/git/source/compare/revisions/0b6438955f2a5a7981fd25cfa5b48fe3fb4c888d,7771e638d1356a14d1dc46f3f5cfaab858370a5e\",\n "unsubscribeURL": "https://domain.com:443/unsubscribe?token=receiverToken&type=COMMITS&projectId=64249\",\n "invokerEmail": "[email protected]",\n "projectURL": "https://domain.com/project/64249\",\n "projectId": "64249",\n "afterPushRevision": "7771e638d1356a14d1dc46f3f5cfaab858370a5e",\n "invokerId": "38074",\n "pushDate": "2014-02-11T15:26:36+0000",\n "beforePushRevision": "0b6438955f2a5a7981fd25cfa5b48fe3fb4c888d",\n "repositoryURL": "git_url",\n "subdomain": "subdomain",\n "domain": "domain",\n "branch": "develop",\n "invokerProfileURL": "url",\n "commitsCount": "1",\n "invokerSmallAvatarURL": "xx",\n "projectName": "NAME",\n "invoker": "Invoker Name.",\n "commits": {

{ payload: '{\\n \\"taskDueDate\\": \\"No due\\",\\n \\"oldTaskMilestone\\": null,\\n \\"isUpdatedTask\\": \\"true\\",\\n \\"oldTaskAssignee\\": null,\\n \\"statusType\\": \\"OPEN\\",\\n \\"oldTaskVisibility\\": null,\\n \\"isEstimationUpdated\\": \\"false\\",\\n \\"invokerEmail\\": \\"mike@domain\\",\\n \\"oldTaskStatus\\": \\"Resolved\\",\\n \\"projectId\\": \\"61193\\",\\n \\"taskContent\\": \\"Add god to monit background processes\\",\\n \\"taskAssignee\\": \\"Mike B.\\",\\n \\"invokerId\\": \\"38073\\",\\n \\"isLabelsUpdated\\": \\"false\\",\\n \\"taskLabels\\": \\"Improvement\\",\\n \\"isAssignmentUpdated\\": \\"false\\",\\n \\"oldTaskEstimation\\": null,\\n \\"isVisibilityUpdated\\": \\"false\\",\\n \\"isStatusUpdated\\": \\"true\\",\\n \\"isMilestoneUpdated\\": \\"false\\",\\n \\"domain\\": \\"xxx\\",\\n \\"invokerSmallAvatarURL\\": \\"xxx\\",\\n \\"invoker\\": \\"Mike B.\\",\\n \\"taskId\\": \\"33\\",\\n \\"accountURL\\": \\"xx\\",\\n \\"taskAuthor\\": \\"Mike B.\\",\\n \\"
@mbajur
mbajur / url.rb
Created February 20, 2014 13:34
AZURE SAS URL Generator
require 'time'
require 'openssl'
require "base64"
require 'uri'
require 'addressable/uri'
def create_signature(path = '/', resource = 'b', permissions = 'r', start = '', expiry = '', identifier = '')
# If resource is a container, remove the last part (which is the filename)
path = path.split('/').reverse.drop(1).reverse.join('/') if resource == 'c'
canonicalizedResource = "/mediasvc78m7lfh2gnn2x/#{path}"
@mbajur
mbajur / nginx
Created April 2, 2014 20:04
nginx startup script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@mbajur
mbajur / README.md
Created June 27, 2014 11:12
Add git branch name to terminal prompt (mac)

Open up your bash profile file with

vim ~/.bash_profile

and at the end of that file, add:

# Git branch in prompt.
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'

}

@mbajur
mbajur / gist:d65c92445f48603424e7
Created March 12, 2015 16:43
Install drone.io

(important) Setup ubuntu to use aufs driver for drone

sudo apt-get install linux-image-extra-$(uname -r)
sudo reboot

Install docker

curl -s https://get.docker.io/ubuntu/ | sudo sh

Install drone.io

@mbajur
mbajur / .md
Created April 29, 2016 07:16
How to create small, unique tokens in Ruby

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):

@mbajur
mbajur / letsencrypt.md
Created May 9, 2016 13:25 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@mbajur
mbajur / alt-action-listeners.js.es6
Last active June 28, 2017 18:06
alt.js - listening for events outside of the store
/**
* ActionListeners(alt: AltInstance): ActionListenersInstance
*
* > Globally listen to individual actions
*
* If you need to listen to an action but don't want the weight of a store
* then this util is what you can use.
*
* Usage:
*