#Git notes
Warning : Support for isplay of git notes has been dropped by github : https://github.com/blog/707-git-notes-display
Resource : https://vimeo.com/34273537
##Add
git notes add
| :: autoupdate.bat - hands-off script to fully patch a fresh Windows install (https://git.io/vzWKw) | |
| :: | |
| :: Usage: save this file to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup and run it | |
| :: | |
| :: Derived from a post by EzR (http://serverfault.com/a/732084/55554) | |
| :begin | |
| wuauclt /DetectNow | |
| wuauclt /UpdateNow |
| function Write-HostAnsi { | |
| <# | |
| .SYNOPSIS | |
| Wrapper for Write-Host, adds ANSI SGR codes based on -foregroundColor and -backgroundColor | |
| #> | |
| param( | |
| $object, | |
| $foregroundColor, | |
| $backgroundColor |
| using System; | |
| using System.Threading.Tasks; | |
| using Splunk.Client; | |
| using System.Net; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| namespace kvstore | |
| { | |
| class Program |
| //in setup define client and progress reporter | |
| var httpProgressHandler = new ProgressMessageHandler(); | |
| httpProgressHandler.InnerHandler = new HttpClientHandler(); | |
| var client = new HttpClient(httpProgressHandler) { BaseAddress = new Uri(Settings.Default.ServerUrl) }; | |
| //register to use elsewhere in the application, note it is better to resuse for lifetime of application than create for every call | |
| Mvx.RegisterSingleton(client); | |
| Mvx.RegisterSingleton(httpProgressHandler); |
#Git notes
Warning : Support for isplay of git notes has been dropped by github : https://github.com/blog/707-git-notes-display
Resource : https://vimeo.com/34273537
##Add
git notes add
| param( | |
| [Parameter(Mandatory=$true)][string]$pathToBeAdded | |
| ) | |
| $local:oldPath = get-content Env:\Path | |
| $local:newPath = $local:oldPath + ";" + $pathToBeAdded | |
| set-content Env:\Path $local:newPath |
| $ErrorActionPreference = "Stop" | |
| $notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString() | |
| [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null | |
| $template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01) | |
| #Convert to .NET type for XML manipuration | |
| $toastXml = [xml] $template.GetXml() | |
| $toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null |
| #Requires -RunAsAdministrator | |
| #Requires -Version 5.0 | |
| $ErrorActionPreference = "Stop" | |
| function Main | |
| { | |
| #Size of dummy file, that transffered by PSRemoting. | |
| $fileSize = 10MB |
| echo ------------------------------------------------------------ | |
| echo --- installing curl | |
| echo ------------------------------------------------------------ | |
| sudo apt-get install -y curl | |
| curl -sL https://deb.nodesource.com/setup | sudo bash - | |
| echo ------------------------------------------------------------ | |
| echo --- installing git | |
| echo ------------------------------------------------------------ | |
| sudo apt-get install -y git |
| // UPDATE! | |
| // In Json.NET 7, a DictionaryKeyResolver was added. | |
| // This might be able to fix the problem more elegantly. | |
| // I haven't checked though. | |
| public class DictionaryJsonConverter : JsonConverter | |
| { | |
| public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | |
| { | |
| var dictionary = (IDictionary)value; |