Skip to content

Instantly share code, notes, and snippets.

@jonathancounihan
jonathancounihan / prepare-commit-msg.sh
Last active October 13, 2018 18:59 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
@jonathancounihan
jonathancounihan / range.knockout.js
Created May 12, 2019 11:59 — forked from hereswhatidid/range.knockout.js
Knockout extender to force a field to be an integer value within a specified range.
ko.extenders.range = function( target, intRange ) {
//create a writeable computed observable to intercept writes to our observable
var result = ko.computed({
read: target, //always return the original observables value
write: function( newValue ) {
var current = target(),
newValueAsNum = isNaN( newValue ) ? 0 : parseInt( +newValue, 10 ),
valueToWrite = newValueAsNum;
if ( newValueAsNum < intRange.min ) {
@jonathancounihan
jonathancounihan / Enable-Transformations.md
Created May 14, 2019 12:24 — forked from EdCharbeneau/Enable-Transformations.md
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation