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
#include "on_scope_exit.hpp" | |
#include <string> | |
#include <string_view> | |
#include <vector> | |
#include <Windows.h> | |
#include <stringapiset.h> | |
#include <winhttp.h> |
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
#include "xxhash.hpp" | |
#include <iostream> | |
extern void process(); | |
int main(int, char **) | |
{ | |
process(); | |
std::cout << "xxhash<32>(1) => " << xxh::xxhash<32>(std::array<uint32_t, 1>{1}) << std::endl; | |
} |
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
{ | |
"configurations": [ | |
{ | |
"name": "WSL", | |
"intelliSenseMode": "gcc-x64", | |
"compilerPath": "/usr/bin/gcc", | |
"includePath": [ | |
"${command:extension.vscode-wsl-workspaceFolder}/**", | |
"/usr/include/**" | |
], |
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
git init test-repo | |
echo *.c > .\test-repo\.gitignore | |
mkdir .\test-repo\subdir | |
type nul > .\test-repo\subdir\a.c | |
echo Expect to see .gitignore untracked, subdir/a.c ignored | |
git -C .\test-repo status --untracked=all --ignored=matching --short | |
echo !*.c > .\test-repo\subdir\.gitignore | |
echo Expect to see .gitignore, subdir/.gitignore and subdir/a.c all untracked | |
git -C .\test-repo status --untracked=all --ignored=matching --short | |
git -C .\test-repo add .\.gitignore .\subdir\.gitignore |
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
# 'last(ancestors(branch(release)) & tag('re:^v[0-9.]+')):' - all commits since last tag matching '^v[0-9.]+' | |
# 'merge()' - just merge commits | |
# branch(release) - on the release branch | |
hg log -r "last(ancestors(branch(release)) & tag('re:^v[0-9.]+')): & merge() & branch(release)" --template "{node|short}: {desc|firstline}\n" |
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]$directory = $PSScriptRoot, | |
[ValidateSet('c','C','c++','C++','f#','F#')] | |
[string]$language, | |
[string]$revision, | |
[string]$output, | |
[string]$tagPrefix = 'v' | |
) | |
$directory = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($directory) |
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
open Printf | |
open System | |
open System.Diagnostics | |
open System.Text | |
open System.Text.RegularExpressions | |
type System.String with | |
member s.SplitAt(index) = | |
let lengthToUse = min index s.Length | |
(s.Substring(0, lengthToUse), s.Substring(lengthToUse)) |
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
#[test] | |
fn combine_glob_and_child() { | |
assert_eq!(combine_imports(&(vec![&ViewPath::from("a::b::c"), | |
&ViewPath::from("a::b::*")])), | |
vec![ViewPath::from("a::b::*")]); | |
assert_eq!(combine_imports(&vec![&ViewPath::from("a::b::c"), | |
&ViewPath::from("a::b::*"), | |
&ViewPath::from("a::b as x")]), | |
vec![ViewPath::from("a::b as x"), ViewPath::from("a::b::*")]); | |
assert_eq!(combine_imports(&vec![&ViewPath::from("a::b::c"), |
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
module A where | |
import Control.Monad | |
-- Data types... | |
-- | |
-- class Residence { | |
-- var numberOfRooms: Int | |
-- } | |
data Residence = Residence { rooms :: Int } deriving (Show) |
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
#include <bitset> | |
#include <iostream> | |
using std::bitset; | |
namespace detail | |
{ | |
// Create a bitset from bools (or things convertible to bool). The first bool is the high-order | |
// bit, the size of the bitset determined by the size of the parameter pack. | |
template<class... Args> | |
bitset<sizeof...(Args)> make_bitset(Args const&... args) |