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
| module RomanNumerals | |
| // Define function | |
| let convertToRoman n = | |
| let steps = [ | |
| (1, 3, "I") | |
| (4, 4, "IV") | |
| (5, 8, "V") | |
| (9, 9, "IX") |
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 IEnumerable<T> SortMerge<T, TKey>(Func<T, TKey> orderBy, params IEnumerable<T>[] sortedEnumerables) | |
| { | |
| var enumerators = sortedEnumerables | |
| .Select(e => e.GetEnumerator()) | |
| .Where(e => e.MoveNext()) | |
| .ToList(); | |
| while (enumerators.Any()) | |
| { | |
| var next = enumerators |
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
| Bind<ILog>().ToMethod(context => LogManager.GetLogger(context.Request.Target.Member.DeclaringType)); |
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
| git config --global merge.tool p4merge | |
| git config --global mergetool.p4merge.cmd 'p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"' | |
| git config --global diff.tool p4merge | |
| git config --global difftool.p4merge.cmd 'p4merge.exe \"$LOCAL\" \"$REMOTE\"' |
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
| -V2 --add-id3v2 --pad-id3v2 --ta "%artist%" --tt "%title%" --tg "%genre%" --tl "%albumtitle%" --ty "%year%" --tn "%tracknr2%" %source% %dest% |
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
| internal static class Win32 | |
| { | |
| private const int GWL_STYLE = -16; | |
| private const int WS_SYSMENU = 0x80000; | |
| [DllImport("user32.dll", SetLastError = true)] | |
| private static extern int GetWindowLong(IntPtr hWnd, int nIndex); | |
| [DllImport("user32.dll")] | |
| private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); |
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
| Windows Registry Editor Version 5.00 | |
| [HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\Lync] | |
| "DisableServerCheck"=dword:00000001 |
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
| protected override CreateParams CreateParams | |
| { | |
| get | |
| { | |
| var @params = base.CreateParams; | |
| // WS_EX_COMPOSITED (0x02000000L) | |
| // Paints all descendants of a window in bottom-to-top painting order using double-buffering. | |
| // Ref.: http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543.aspx | |
| @params.ExStyle |= 0x02000000; |
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
| <#@ template language="C#" #> | |
| <#@ output extension=".cs" #> | |
| <# | |
| var exceptions = new [] | |
| { | |
| DefineException("Message"), | |
| DefineException("BadResponse").DerivedFrom("Message"), | |
| DefineException("InvalidState") | |
| }; | |
| //---------------------------------------------------------------------------------- |
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 Convert-Currency { | |
| param($from = "eur", $to = "nok") | |
| $url = "https://www.google.com/finance/converter?a=1&from=$from&to=$to" | |
| $result = Invoke-WebRequest $url | |
| $result.AllElements | Where id -eq 'currency_converter_result' | Select -ExpandProperty innerText | |
| } |
OlderNewer