Skip to content

Instantly share code, notes, and snippets.

@marknadig
marknadig / myPromiseMock.js
Created September 1, 2015 16:25
An angular promise mock
myMocks = {
promise: function() {
return {
_success: [],
_failure: [],
then: function (_success, _failure) {
this._success.push(_success);
this._failure.push(_failure);
return this;
},
@marknadig
marknadig / AutoRebuild.js
Created January 26, 2017 16:29
Poll and auto-rebuild failed TFS merge
var poller;
var pollForBuild = function() {
// Approved yet?
if ($(".vc-pullrequest-merge-policy-status-item span:contains('approved')").length == 0) {
console.log("Poller: waiting for approval");
return;
}
// build succeeded?
if ($(".vc-pullrequest-merge-policy-status-item a:contains('succeeded')").length) {
var empExp = String.Join(",", employeeIds.Select(u => $"'{DoubleQuote(u)}'"));
Dim empExp = String.Join(",", employeeIds.Select(Function(u) $"'{DoubleQuote(u)}'"))
@echo off
if not exist C:\Temp\hard-source\ GOTO 30
@echo Cleaning hard source
rmdir /s /q C:\Temp\hard-source
:30
if not exist C:\Development\Vantagepoint\ GOTO 20
@echo Cleaning 30
rmdir /s /q C:\Development\Vantagepoint\code\client\DeltekNavigator\Web\dist
rmdir /s /q C:\Development\Vantagepoint\code\client\DeltekNavigator\Web\node_modules
:20
@marknadig
marknadig / sweep.sh
Created December 29, 2020 16:11
clean ._ and .DS_Store
find . -name .DS_Store -type f -delete; find . -type d -print0 | xargs -0 dot_clean