https://cloud.githubusercontent.com/assets/6932589/25092053/fe6987b4-2359-11e7-891a-1359252725ef.png
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Http = (function ($, storage, self) { | |
var _contentType = 'application/json; charset=utf-8', | |
_dataType = 'json', | |
_key = 'token'; | |
function getToken() { | |
return storage.getItem(_key); | |
} | |
function setAuthHeader(xhr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Module = (function(self){ | |
function bindElements(){ | |
// wire up references to elements | |
} | |
function bindEvents(){ | |
} | |
function init(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# core {{{ | |
[core] | |
editor = /usr/bin/vim | |
excludesfile = /Users/np/.gitignore_global | |
pager=less -x4 | |
#}}} | |
# user {{{ | |
[user] | |
email = [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var message = process.argv[2]; | |
var hasTicketRef = (message !== undefined && message !== null && message.length > 0 && message.substring(0,4) === 'ABP-'); | |
var exitCode = (hasTicketRef)? 0 : 1; | |
if(!hasTicketRef){ | |
console.log('Jira ABP ticket reference required! \n Example:\n git commit -m "ABP-0000 #resolve #time 3h 20m"'); | |
} | |
process.exit(exitCode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Require Jira Ticket in commit message | |
WARNING="Jira ABP ticket reference NOT FOUND but is required!" | |
MESSAGE=$(<$1) | |
case "$MESSAGE" in | |
"ABP-"*) | |
exit 0; | |
;; | |
*"ABP-"*) | |
WARNING="Jira ABP reference MUST be the 1st token in your message!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Net.Http; | |
using System.Net; | |
namespace HTTP_Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const asyncThingWithPromise = () => { | |
var promise = new Promise((resolve, reject) => { | |
try{ | |
// do something async here. Like get data from a server or read a file from disk etc. | |
var value = 'My Async Data'; | |
resolve(value) // handled by promise's then() | |
}catch(error){ | |
reject(error) // handled by promise's catch() | |
} |