Skip to content

Instantly share code, notes, and snippets.

@kraihn
kraihn / prepare-commit-msg
Last active February 9, 2018 17:02
Prefix Commit Message with Jira Issue
#!/usr/bin/env node
var exec = require('child_process').exec,
util = require('util'),
fs = require('fs'),
contents = null,
branch, desc;
// expect .git/COMMIT_EDITMSG
if(/COMMIT_EDITMSG/g.test(process.argv[2])){
// look for current branch name
@kraihn
kraihn / prepare-commit-msg.cmd
Created June 4, 2015 19:34
Prefix Commit Message with Jira Issue on Windows
@node "%~dp0prepare-commit-msg" %*
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
; EditorConfig to support per-solution formatting.
; Use the EditorConfig VS add-in to make this work.
; http://editorconfig.org/
; This is the default for the codeline.
root = true
[*]
end_of_line = CRLF
@kraihn
kraihn / NPM.md
Last active April 10, 2017 23:58
NPM Globals

NPM Global packages

npm install -g yo@latest typescript@latest tslint@latest eslint@latest rimraf@latest
@kraihn
kraihn / swagger-ui-auth0-jwt.js
Last active May 19, 2017 15:21
Intercept redirect_uri and set id_token from Auth0 as bearer token
function setToken(t) {
var token = "Bearer " + t;
swaggerUi.api.clientAuthorizations.remove('bearer_key');
swaggerUi.api.clientAuthorizations.add("bearer", new SwaggerClient.ApiKeyAuthorization("Authorization", token, "header"));
}
if (!window.isOpenReplaced) {
window.open = function (open) {
return function (url) {
// send us back to where we came from!
@kraihn
kraihn / .gitconfig
Created June 15, 2017 13:24
WebStorm as Git mergetool
[merge]
tool = webstorm
[mergetool "webstorm"]
cmd = cmd.exe //c "\"FULL_PATH_TO-->/webstorm.bat" merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"\"
trustExitCode = true
[diff]
tool = webstorm
[difftool "webstorm"]
cmd = cmd.exe //c "\"FULL_PATH_TO-->/webstorm.bat" diff \"$LOCAL\" \"$REMOTE\"\"
{
"name": "Microsoft Azure",
"description": "This theme includes element styles with icons for each of the Azure services, based upon the Microsoft Azure icon set (https://docs.microsoft.com/en-us/azure/architecture/icons/).",
"elements": [
{
"tag": "Element"
},
{
"tag": "Software System",
"background": "#1168bd",