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
| Get-Project -All | %{ $proj = $_; Get-Package -Project $_.Name | %{ $pkg = $_; Uninstall-Package -Id $pkg.Id -ProjectName $proj.Name -Force; Install-Package -Id $pkg.Id -ProjectName $proj.Name -Version $pkg.Version } } |
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
| public static class WebRequestExtensions | |
| { | |
| public static HttpWebRequest CloneRequest(this HttpWebRequest originalRequest, Uri newUri) | |
| { | |
| return CloneHttpWebRequest(originalRequest, newUri); | |
| } | |
| public static WebRequest CloneRequest(this WebRequest originalRequest, Uri newUri) | |
| { | |
| var httpWebRequest = originalRequest as HttpWebRequest; |
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
| $hash = @{}; $list = cat .gitmodules | where { $_ -like "*=*" } | foreach { $_.Split("=")[1].Trim() }; while ($list) { $key, $value, $list = $list; $hash[$key]=$value }; $hash.GetEnumerator() | foreach { & git submodule add $_.Value $_.Name } |
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 getTypeName(value) { | |
| if (value === null) { | |
| return "null"; | |
| } | |
| var t = typeof value; | |
| switch (t) { | |
| case "function": | |
| case "object": | |
| if (value.constructor && value.constructor.name) { |
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 toggle-list-sep | |
| { | |
| $path = "hkcu:\Control Panel\International" | |
| $key = "sList" | |
| $cur_sep = (Get-ItemProperty -path $path -name $key).$key | |
| if ($args.Length -gt 0) { $value = $args[0] } | |
| elseif ($cur_sep -eq ",") { $value = "|" } | |
| else { $value = "," } |
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 ($) { | |
| /// <summary>JQuery plugin for handling cascading html select lists</summary> | |
| /// <param name="$" type="jQuery">JQuery</param> | |
| $.fn.cascadingSelect = function() { | |
| this.each(function() { | |
| var $e = $(this); | |
| var $p = $($e.attr("data-ui-cascading-parent")); | |
| $e.data('cascading-opts', $e.find("option:gt(0)")); |
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
| public static class Extensions | |
| { | |
| public static TResult SafeInvoke<TModel, TResult>(this TModel model, Func<TModel, TResult> expression, TResult nullValue = default(TResult)) | |
| { | |
| try | |
| { | |
| return expression(model); | |
| } | |
| catch (NullReferenceException) | |
| { |
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
| //---><8--------------------------- UI loads viewmodels and generates commands ---- | |
| UI.Viewmodel = ViewModelStore.Query(UI.SomeParameters); | |
| UI.HandleInput = GeneratedCommand => CommandStore.Add(GeneratedCommand); | |
| //---><8--------------------------- Commands to events ----------------------------------------- | |
| // This uses an iterator because a command should only be handled once | |
| while(CommandStore.HasCommands) |
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
| var model = new | |
| { | |
| Accounts = accounts.Select(x => x.ToExpando()), | |
| TotalUsers = totalUsers, | |
| Page = page, | |
| }; | |
| return View(model.ToExpando()); |