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
public class AlphabeticalOrderJsonContractResolver : CamelCasePropertyNamesContractResolver | |
{ | |
protected override IList<JsonProperty> CreateProperties( | |
Type type, | |
MemberSerialization memberSerialization | |
) | |
{ | |
return base.CreateProperties(type, memberSerialization) | |
.OrderBy(p => p.PropertyName) | |
.ToList(); |
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
# Remove [TestInitialize] attribute and replace Initialise method name with class name for constructor | |
(public\sclass\s(\w*).*((\r\n|\r|\n).*)*)\[TestInitialize\]\n.*(public\s)void\s(\w*) | |
(public\sclass\s(\w*).*((\r\n|\r|\n).*)*)\[TestInitialize\]\n.*(public\s)async\sTask\s(\w*) | |
# Replace substitutions | |
$1$5$2 |
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
# Backup | |
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_$(date +"%Y-%m-%dT%H-%M-%S").sql | |
# Backup gzipped | |
docker exec -t your-db-container pg_dumpall -c -U postgres | gzip > ./tmp/dump_$(date +"%Y-%m-%dT%H-%M-%S").gz | |
# ------------------------------------------------------------------------------------------------------------- | |
# Restore | |
cat your_dump.sql | docker exec -i your-db-container psql -U postgres |
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
function person() { | |
return { name: 'Matt', age: 25 }; | |
} | |
// Object destructuring | |
let { name, age } = person(); | |
// name === 'Matt' | |
// age === 25 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public class Person | |
{ | |
public string Name { get; } |