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
| # NOTE: this has to be run as administrator | |
| # generate self-signed cert for the local test.internal domain name, set the expiration to 10 years from now | |
| $domain = "test.internal" | |
| $cert = New-SelfSignedCertificate -DnsName "$domain", "localhost" -FriendlyName "$domain" -KeyExportPolicy Exportable -CertStoreLocation cert:\LocalMachine\My -NotAfter (Get-Date).AddYears(10) | |
| # export the cert to a temp file | |
| Export-Certificate –Cert $cert –FilePath "$env:temp\export.cer" | |
| # import the cert to the trusted root |
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
| Copyright 2019 Travis Hardiman | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| * The software may not be used by individuals, corporations, governments, or other groups for systems or activities that actively and knowingly endanger, harm, or otherwise threaten the physical, mental, economic, or general well-being of individuals or groups in violation of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/). | |
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
| { | |
| "globals" : | |
| { | |
| "alwaysShowTabs" : true, | |
| "defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
| "initialCols" : 120, | |
| "initialRows" : 30, | |
| "keybindings" : | |
| [ | |
| { |
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
| //using System; | |
| //using System.Data.Entity.Core.Metadata.Edm; | |
| //using System.Data.Entity.Infrastructure; | |
| //using System.Linq; | |
| //using System.Linq.Expressions; | |
| public static int GetMaxLength<T>(Expression<Func<T, string>> column) | |
| { | |
| int result = -1; | |
| var entType = typeof(T); |
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
| //using System.Linq; | |
| List<List<string>> SomeData = new List<List<string>>(); | |
| // add values (first item as column names) | |
| SomeData.Add(new List<string> | |
| { | |
| "Id", | |
| "Name", | |
| "etc" |
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
| //using System.Collections.Generic; | |
| //using System.ComponentModel; | |
| //using System.Dynamic; | |
| private static dynamic GetDynamic(object value) | |
| { | |
| IDictionary<string, object> expando = new ExpandoObject(); | |
| foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(value.GetType())) | |
| { |
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
| //using Newtonsoft.Json; | |
| //private const bool FORMAT_JSON = true; | |
| private static string GetJson(object convertToJson) | |
| { | |
| string serial = JsonConvert.SerializeObject(convertToJson, FORMAT_JSON ? Formatting.Indented : Formatting.None); | |
| return serial; | |
| } |
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
| #!/bin/bash | |
| set -euo pipefail | |
| INFO='\e[38;05;14m' | |
| NC='\033[0m' # No Color | |
| # apt | |
| echo -e "${INFO}apt update${NC}"; | |
| sudo apt update && echo -e "${INFO}apt list --upgradable${NC}" && apt list --upgradable; | |
| # snap |
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
| Verifying my Blockstack ID is secured with the address 1JFNUe8sgLv5EvjjRa6yAQ5eTBdVUFYUzy https://explorer.blockstack.org/address/1JFNUe8sgLv5EvjjRa6yAQ5eTBdVUFYUzy |
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
| { | |
| "Condition statement": { | |
| "prefix": "cond", | |
| "body": [ | |
| "${_} { ${0}; break }" | |
| ], | |
| "description": "Switch condition statement" | |
| }, | |
| "Condition single quoted string statement": { |