These are snippets I use to find text in specific types of files.
.css;.scss;!*.min.css
(<a[^>]+>)([\w ]+)</a> | |
$1@Localizer["$2"]</a> |
const string LoremIpsum = @"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; | |
private static readonly Regex WordRegex = new Regex(@"\w+\W+"); | |
private static readonly string[] LoremIpsumWords = WordRegex.Matches(LoremIpsum).Select(m => m.Value).ToArray(); | |
private string LoregmIpsum(int count) | |
{ | |
var output = new StringBuilder(); | |
if (count > LoremIpsumWords.Length) output.AppendJoin(" ", Enumerable.Repeat(LoremIpsum, count / LoremIpsumWords.Length)); | |
output.Append(" "); | |
output.AppendJoin(null, LoremIpsumWords.Take(count % LoremIpsumWo |
(function ($) { | |
// Make ASP's unobtrusive validation compatible with Bootstrap 5 styling. See this for more details: https://stackoverflow.com/a/19006517/576153 | |
$.validator.setDefaults({ | |
errorElement: "span", | |
errorClass: "invalid-feedback", | |
highlight: function (element, errorClass, validClass) { | |
// Only validation controls | |
if (!$(element).hasClass('novalidation')) { | |
$(element).closest('.form-control').removeClass('is-valid').addClass('is-invalid'); | |
} |
// This script highlights touchable elements on the page that are either too small or too close together according to Google. | |
// https://support.google.com/webmasters/answer/9063469#touch_elements_too_close | |
const MinimumSize = 48; | |
const MinimumMargin = 8; | |
let clickableNodesList = document.querySelectorAll('a,button'); | |
for (let ia = 0; ia < clickableNodesList.length; ia++){ | |
let aElement = clickableNodesList[ia]; | |
let aBound = aElement.getBoundingClientRect(); |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: helm-controller | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: helm-controller |
This gist describes how to add Kubernetes customDismensions to the Java agent for Application Insights.
It's supplying the same customDimensions that are provided by the asp.net 6+ instrumentiation, except that not all of those dimensions are available using the Kubernetes Downward API
The supplied app-insights-java.yaml patch file configures customDimensions for the app insights agent using the APPLICATIONINSIGHTS_CONFIGURATION_CONTENT
env var.
This will override your applicationinsights.json configuration file if you were using one.
echo "setting alias clip-branch to copy the current git branch to the Windows clipboard" | |
echo "alias clip-branch='git rev-parse --abbrev-ref HEAD | tr -d '\n' | clip.exe'" |