jenkins_url + /api/json?tree=jobs[name,color]
jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]
| #Quick and dirty PS script for counting lines of code in a directory. Output is dumped to a simple CSV file. | |
| #Note that this script doesn't count blank lines. | |
| #Parameters: | |
| # path - the path containing the code files (note that the script will recurse through subfolders | |
| # outputFile - fully qualified path of the file to dump the CSV output | |
| # include (Optional) - file mask(s) to include in the count (deafults to *.*) | |
| # exclude (Optional) - file mask(s) to exclude in the count (defaults to none) | |
| # Example (count lines in target path including *.cs but excluding *.designer.cs) | |
| # .\countLOC.ps1 -path "C:\code\MyProject" -outputFile "C:\code\loc.csv" -include "*.cs" -exclude "*.designer.cs" | |
| param([string]$path, [string]$outputFile, [string]$include = "*.*", [string]$exclude = "") |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Net; | |
| namespace EventStoreService | |
| { | |
| public class EventStoreService | |
| { |
| Set-ExecutionPolicy RemoteSigned | |
| $mongoDbPath = "C:\MongoDB" | |
| $mongoDbConfigPath = "$mongoDbPath\mongod.cfg" | |
| $url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip" | |
| $zipFile = "$mongoDbPath\mongo.zip" | |
| $unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9" | |
| if ((Test-Path -path $mongoDbPath) -eq $True) | |
| { |
| public class ProjectRepository | |
| { | |
| private CloudTable table; | |
| public ProjectRepository() | |
| { | |
| var connectionString = "..."; | |
| CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString); | |
| var client = storageAccount.CreateCloudTableClient(); |
| public class Project | |
| { | |
| public Guid Owner { get; set; } | |
| public Guid Id { get; set; } | |
| public string Name { get; set; } | |
| public DateTime StartDate { get; set; } | |
| public int Status { get; set; } | |
| public List<Task> Tasks { get; set; } | |
| } |
| /** | |
| * A generic confirmation for risky actions. | |
| * Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function | |
| */ | |
| angular.module('app').directive('ngReallyClick', [function() { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs) { | |
| element.bind('click', function() { | |
| var message = attrs.ngReallyMessage; |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| // Returns a function, that, as long as it continues to be invoked, will not | |
| // be triggered. The function will be called after it stops being called for | |
| // N milliseconds. If `immediate` is passed, trigger the function on the | |
| // leading edge, instead of the trailing. | |
| function debounce(func, wait, immediate) { | |
| var timeout; | |
| return function() { | |
| var context = this, args = arguments; | |
| clearTimeout(timeout); |
| ### http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12 | |
| # Add and Enable SSL 3.0 for client and server SCHANNEL communications | |
| md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force | |
| md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force | |
| New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force | |
| New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force | |
| # Add and Enable TLS 1.0 for client and server SCHANNEL communications | |
| md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0' -Force |