This file contains hidden or 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
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration") | |
$siteName = "Default Web Site" | |
$vApp = "/HV" | |
$serverManager = New-Object Microsoft.Web.Administration.ServerManager | |
$site = $serverManager.Sites | where { $_.Name -eq $siteName } | |
$rootApp = $site.Applications | where { $_.Path -eq $vApp } |
This file contains hidden or 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
@ECHO OFF | |
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State : Disabled" > nul | |
if %ERRORLEVEL% == 0 ( | |
echo "IIS Web Server is not installed" | |
dism /online /enable-feature /featurename:IIS-WebServer /all | |
) | |
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State" |
This file contains hidden or 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
Timer t = new Timer(60000) {AutoReset = true}; | |
t.Elapsed += new System.Timers.ElapsedEventHandler(DoSomeStuff); | |
t.Start(); | |
private void DoSomeStuff(object sender, ElapsedEventArgs e) | |
{ | |
// do something | |
} |
This file contains hidden or 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
@echo off | |
call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" | |
:start | |
echo Build Start: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%.%TIME:~9,2% | |
%WINDIR%\Microsoft.NET\Framework\%FrameworkVersion%\msbuild.exe (.msbuildfile) (params) | |
:end | |
echo Build Completed: %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%.%TIME:~9,2% |
This file contains hidden or 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
#ConvertTo-SecureString -String "yourpassword" -AsPlainText -Force | ConvertFrom-SecureString | Set-Content "password.txt" | |
$servicename = "yourcloudservice" | |
$username = "remotedesktopuser" | |
$securepassword = Get-Content -Path "password.txt" | ConvertTo-SecureString | |
$expiry = $(Get-Date).AddDays(1) | |
$credential = New-Object System.Management.Automation.PSCredential $username,$securepassword | |
Set-AzureServiceRemoteDesktopExtension -ServiceName $servicename -Credential $credential -Expiration $expiry |
This file contains hidden or 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
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.eot']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.eot',mimeType='application/vnd.ms-fontobject']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.ttf']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.ttf',mimeType='application/octet-stream']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.svg']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.svg',mimeType='image/svg+xml']" | |
& $Env:WinDir\system32\inetsrv\appcmd.exe set config /section:staticContent /-"[fileExtension='.woff']" |
This file contains hidden or 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
string[] assemblyLocations = GetAssemblyLocation(new string[] { "System.Web.dll", "System.dll", "EntityFramework.dll" }); | |
private string[] GetAssemblyLocation(string[] assemblyNames) | |
{ | |
string[] locations = new string[assemblyNames.Length]; | |
for (int loop = 0; loop <= assemblyNames.Length - 1; loop++) | |
{ | |
locations[loop] = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && a.ManifestModule.Name == assemblyNames[loop]).Select(a => a.Location).FirstOrDefault(); | |
} |
This file contains hidden or 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
describe('homeController', function () { | |
beforeEach(module('revokinatorApp')); | |
beforeEach(module('Revokinator.Home.Controller')); | |
var $controller; | |
beforeEach(inject(function (_$controller_) { | |
// The injector unwraps the underscores (_) from around the parameter names when matching | |
$controller = _$controller_; |
This file contains hidden or 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 whatever(){ | |
var deferred = $q.defer(); | |
$http.get("https://cmsservice.wopr.rapidgate.com:9001/ActivIDService.svc/api/v1/process/status", []) | |
.success(function (data) { | |
tmpData.returnData = data; | |
deferred.resolve(); | |
}).error(function (data,status) { | |
// possible error reporting |
This file contains hidden or 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
// Send Request Method | |
sendRequest = { | |
async: function (url, method, param) { | |
// $http returns a promise, which has a then function, which also returns a promise | |
var promise = $http.get(url).then(function (response) { | |
// The then function here is an opportunity to modify the response | |
// store the response status and text | |
tmpData.requestStatus = response.status; | |
tmpData.requestStatusText = response.statusText; |