[C++]
prefer expressions over statements[C++]
prefer immutability over mutability[C++]
prefer composition over inheritance[Qt]
preferSTL
overQTL
containers
This file contains 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
$script:bg = [Console]::BackgroundColor; | |
$script:first = $true; | |
$script:last = 0; | |
function Write-PromptFancyEnd { | |
Write-Host -NoNewline -ForegroundColor $script:bg | |
$script:bg = [System.ConsoleColor]::Black | |
} |
This file contains 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
#I __SOURCE_DIRECTORY__ | |
#r "libs/NuGet.Core.dll" | |
#r "System.Xml.Linq" | |
open NuGet | |
open System | |
open System.IO | |
module NuGet = |
This file contains 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
param ([string[]]$Computer = ".") | |
@($Computer) | % { | |
$c = $_ | |
if ($c -eq '.') { $c = $env:COMPUTERNAME } | |
$os = get-wmiobject Win32_OperatingSystem -Computer $_ | |
$physical = Get-WmiObject CIM_PhysicalMemory -Computer $_ | |
$free = $os.FreePhysicalMemory |
This file contains 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
//... | |
let fscToolPath = findToolFolderInSubPath "fsc.exe" "packages" | |
let msbuildProps = [ "FscToolPath", fscToolPath ] | |
Target "Build" (fun _ -> | |
!! projectFile | |
|> MSBuildReleaseExt releaseDir msbuildProps "Build" | |
|> Log "AppBuild-Output") |
This file contains 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\Control Panel\Accessibility\Keyboard Response] | |
"AutoRepeatDelay"="250" | |
"AutoRepeatRate"="13" | |
"BounceTime"="0" | |
"DelayBeforeAcceptance"="0" | |
"Flags"="59" | |
"Last BounceKey Setting"=dword:00000000 | |
"Last Valid Delay"=dword:00000000 |
This file contains 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
(* | |
ParserLibrary.fsx | |
Final version of a parser library. | |
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/ | |
*) | |
module ParserLibrary |
This file contains 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
(* | |
JsonParser.fsx | |
A JSON parser built from scratch using a combinator library. | |
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/ | |
*) | |
module JsonParser |
This file contains 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
/// Removes Diacritics (tilde, cédille, umlaut and friends) from String | |
let removeDiacritics (s: string) = | |
s.Normalize(NormalizationForm.FormD) | |
|> Seq.filter (fun c -> CharUnicodeInfo.GetUnicodeCategory c <> UnicodeCategory.NonSpacingMark) | |
|> Seq.fold (fun (sb: StringBuilder) c -> sb.Append c) (StringBuilder()) | |
|> string |
This file contains 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
/// <summary>Removes Diacritics (tilde, cédille, umlaut and friends) from String</summary> | |
public static string RemoveDiacritics(this string s) | |
{ | |
string normalizedString = s.Normalize(NormalizationForm.FormD); | |
StringBuilder stringBuilder = new StringBuilder(); | |
for (int i = 0; i < normalizedString.Length; i++) | |
{ | |
char c = normalizedString[i]; | |
if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) |