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.Linq; | |
using NLog; | |
using Raven.Abstractions.Data; | |
using Raven.Bundles.Replication; | |
using Raven.Bundles.Replication.Plugins; | |
using Raven.Json.Linq; | |
namespace MyRavenReplicationBundle | |
{ |
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
'use strict'; | |
(function() { | |
var mod = angular.module("App.services", []); | |
//register other services here... | |
/* pubsub - based on https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js*/ | |
mod.factory('pubsub', function() { | |
var cache = {}; |
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
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf | |
server { | |
listen 80; | |
server_name jira.example.com; | |
access_log off; | |
return 301 https://$server_name$request_uri; | |
} | |
# /etc/nginx/conf.d/jira.conf | |
server { |
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
[TestMethod] | |
public void WhenModelStateIsInvalidDoNotSave() | |
{ | |
var mockRepo = new Mock<IProductRepo>(); | |
mockRepo.Setup(x=>x.Save(It.IsAny<Product>()); | |
var ctrl = new ProductController(mockRepo.Object); | |
ctrl.ModelState.AddModelError("SomeRandomProperty","SomeRandomProperty was not valid"); | |
var actual = ctrl.Post(new Product()); |
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
# ---------- Main Vars to Change----------------- | |
$contentPath = 'C:\MyApp\content' | |
# find the file at example : C:\Users\me\AppData\Local\Temp on my computer | |
$OutPath = "$env:temp\SharePointProjectItem.spdata.fragment.xml" | |
# --------- End Main Vars to Change------------ | |
# Code Summary |
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
(function () { | |
/** | |
* Gist by @EricRohlfs for embeding yammer in an AngularJs SPA. | |
* Assumes you are using open graph and ng-route. | |
* Steps: | |
* 1. include the yammer api script as per their documentation | |
* <script type="text/javascript" src="https://assets.yammer.com/assets/platform_embed.js"></script> | |
* 2. Add the directives <yammer-embed/> or <yammer-follow/> to your page. | |
* 3. in your route config add the openGraph property for each route |
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
# Downloads all the git projects from a Microsoft Visual Studio Team Services (VSTS) account. | |
# Helpful if a team has many git repositories. | |
# change these | |
$project = "myProject" | |
$whereToSaveRoot = "d:\myProject\" | |
# application start | |
$username = Read-Host -Prompt 'UserName from VSTS Alt Credentials' |
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
# PowerShell script to publish all the nuget packages in a project to VSTS Package server | |
$Dir = get-childitem D:\_delete\blah\WebApplication4 -recurse | |
# $Dir |get-member | |
$List = $Dir | where {$_.extension -eq ".nupkg"} | |
$List | format-table name | |
$List | ForEach-Object{ | |
$tempPath = Join-Path $_.Directory $_.name | |
D:\nuget.exe push -Source "MyNugetServerNameOrUrl" -ApiKey VSTS $tempPath | |
} |
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 mockCommit = function (mutations, state) { | |
return function (type, payload) { | |
mutations[type](state, payload) | |
} | |
} | |
// how to do async unit test for vuex without creating a full store. | |
describe('inFlight vuex', () => { | |
let state | |
let mutations |
OlderNewer