Skip to content

Instantly share code, notes, and snippets.

View sirkirby's full-sized avatar
:octocat:

Chris Kirby sirkirby

:octocat:
View GitHub Profile
@sirkirby
sirkirby / afts-5.cs
Last active January 3, 2016 09:59
Azure Full Text Search Ex 5
// optimize to prime index and improve performance
indexWriter.Optimize();
// flush changes and cleanup resources
indexWriter.Dispose();
@sirkirby
sirkirby / ang-pkg.json
Last active August 29, 2015 13:56
Automate nuget with grunt Ex 1
{
"name": "typeaheadjs-nuget",
"version": "0.10.1",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-shell": "~0.6.4",
"grunt-nuget": "~0.1.1"
}
}
@sirkirby
sirkirby / ang-grunt.js
Last active August 29, 2015 13:56
Automate nuget with grunt Ex 2
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["dist"],
shell: {
makeDir: {
command: 'mkdir dist'
}
},
@sirkirby
sirkirby / tfstogit.cmd
Last active September 25, 2015 14:25
clone team project with git-tf
:: notice the --deep argument, this is what will pull down your entire change history to your new git repo
git-tf clone https://myaccount.visualstudio.com/DefaultCollection $/MyBigProject/MyMainBranch --deep
@sirkirby
sirkirby / tfstogit2.cmd
Last active September 2, 2016 12:32
commit files and add a remote
:: from the root, add and commit any new files
git add .
git commit -a -m "initial commit after conversion"
:: add my github remote
git remote add origin https://github.com/sirkirby/myrepo.git
:: send the 'master' branch to the new 'origin' remote
git push origin master
@sirkirby
sirkirby / gen-deployscript.cmd
Last active August 29, 2015 13:56
Generate an azure deployment script for asp.net and node.js web applications using the azure cli tools
:: for my asp.net web application with nuget package restore in the src directory
azure site deploymentscript --aspWAP src/MyAspNetWebApp/MyAspNetWebApp.csproj -s src/MySolution.sln
:: for a node.js web application in the src directory
azure site deploymentscript --node --sitePath src
@sirkirby
sirkirby / aspnet-deployscript.cmd
Last active August 29, 2015 13:56
asp.net deployment script exerpt
:: 1. Restore NuGet packages
IF /I "src\MySolution.sln" NEQ "" (
call :ExecuteCmd "%NUGET_EXE%" restore "%DEPLOYMENT_SOURCE%\src\MySolution.sln"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\src\MyAspNetWebApp\MyAspNetWebApp.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\src\\" %SCM_BUILD_ARGS%
) ELSE (
:: 1. KuduSync
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\src" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Select node version
call :SelectNodeVersion
:: 3. Install npm packages
:: 1. Restore NuGet packages
IF /I "src\MySolution.sln" NEQ "" (
call :ExecuteCmd "%DEPLOYMENT_SOURCE%\tools\nuget\nuget.exe" restore "%DEPLOYMENT_SOURCE%\src\MySolution.sln" -ConfigFile "%DEPLOYMENT_SOURCE%\tools\nuget\nuget.config"
IF !ERRORLEVEL! NEQ 0 goto error
)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="MyPrivateFeed" value="https://www.myget.org/F/privatefeed/" />
<add key="Official" value="http://nuget.org/api/v2/" />
</packageSources>
<packageSourceCredentials>
<MyPrivateFeed>
<add key="Username" value="readonlyuser" />