Skip to content

Instantly share code, notes, and snippets.

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@email.com",\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

/**
* Custom jquery.ui.autocomplete widget
* for main search input
*/
$.widget( "custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var that = this,
currentCategory = "";
$.each( items, function( index, item ) {
if ( item.category != currentCategory ) {
<script type="text/javascript">
Gmaps.map = new Gmaps4RailsGoogle();
Gmaps.load_map = function() {
Gmaps.map.map_options.zoom = 18;
Gmaps.map.map_options.auto_zoom = false;
Gmaps.map.initialize();
Gmaps.map.markers = [{"description":"Description","picture":"/assets/marker.png","width":"32","height":"37","shadow_picture":"/assets/marker_shadow.png","shadow_width":"51","shadow_height":"37","lat":35.6873983,"lng":139.7230538}];
Gmaps.map.create_markers();
Gmaps.map.adjustMapToBounds();
Gmaps.map.callback();
# ...
# Graylog Extended Log Format (GELF)
use_gelf = true
gelf_listen_address = my-domain.com
gelf_listen_port = 12201
# AMQP
amqp_enabled = true
amqp_host = my-domain.com
require 'spec_helper'
describe "Events", type: :controller do
before(:each) do
FactoryGirl.create(:user)
visit '/users/sign_in'
fill_in 'Email', with: User.last.email
fill_in 'Password', with: 'TestPass666'
click_button 'Sign in'