Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Himura2la / Grafana Alert Template.md
Last active April 26, 2024 10:31
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{ define "alert_list" }}{{ range . }}{{ .Labels.alertname }}
    {{ range .Annotations.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
    {{ end }}| {{ if gt (len .GeneratorURL) 0 }}<a href="{{ .GeneratorURL }}">source</a> | {{ end }}{{ if gt (len .SilenceURL) 0 }}<a href="{{ .SilenceURL }}">silence</a> | {{ end }}{{ if gt (len .DashboardURL) 0 }}<a href="{{ .DashboardURL }}">dashboard</a> | {{ end }}{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">panel</a> |{{ end }}
    —
    {{ end }}{{ end }}
    {{ define "telegram.message" }}
    

{{ if gt (len .Alerts.Firing) 0 }}FIRING!!!

@sunderls
sunderls / fbevents.js
Last active April 26, 2024 10:31
facebook pixel js prettified
/*1482118385,,JIT Construction: v2746767,en_US*/
/**
* Copyright Facebook Inc.
*
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
try {
(function(win, doc, location, history) {
'use strict';
@danstadler-pdx
danstadler-pdx / gist:2bdcfb20911b6a87303afdccc04f061c
Created February 7, 2019 22:18
browser snippet from the REST api
curl -X POST 'https://api.newrelic.com/v2/browser_applications.json' \
-H 'X-Api-Key:redacted' -i \
-H 'Content-Type: application/json' \
-d \
'{
"browser_application": {
"name": "made from REST api 2"
}
}'
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active April 26, 2024 10:31
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

<script type="text/javascript">
window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=s(e),f=c.length,u=i(a,o,r),d=0;f>d;d++)c[d].apply(u,n);return u}function a(t,e){f[t]=s(t).concat(e)}function s(t){return f[t]||[]}function c(){return n(e)}var f={};return{on:a,emit:e,create:c,listeners:s,_events:f}}function r(){return{}}var o="nr@context",i=t("gos");e.exports=n()},{gos:"7eSDFh"}],ee:[function(t,e){e.exports=t("QJf3ax")},{}],3:[function(t){function e(t){try{i.console&&console.log(t)}catch(e){}}var n,r=t("ee"),o=t(1),i={};try{n=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(i.console=!0,-1!==n.indexOf("dev")&&(i.dev=!0),-1!==n.indexOf("nr_
<!-- "https://github.com/benwinding/quill-html-edit-button" -->
<!-- var val = "{\"ops\":[{\"insert\":\"A \"},{\"attributes\":{\"bold\":true},\"insert\":\"robot\"},{\"insert\":\" who has developed sentience, \"},{\"attributes\":{\"italic\":true},\"insert\":\"and is\"},{\"insert\":\" the only robot of his kind shown to be still \"},{\"attributes\":{\"link\":\"google.com\"},\"insert\":\"functioning on\"},{\"insert\":\" Earth.\\n\"}]}"
function compose(attr, txt){
if(!attr) {
return txt
} else {
if (attr.bold) {
return "<strong>" + txt + "</strong>"
@wellington1993
wellington1993 / worker.js
Created November 28, 2019 19:13
resource://devtools/client/shared/source-map/worker.js
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
@dealako
dealako / complete-crap.js
Created July 8, 2019 23:00
A bit of JavaScript nonsense
let onlyOnProd = true; // change to false to run scripts that normally only run on prod
if (!onlyOnProd || location.host === 'projectconsole.linuxfoundation.org') {
window.NREUM || (NREUM = {}), __nr_require = function (t, n, e) {
function r(e) {
if (!n[e]) {
var o = n[e] = {exports: {}};
t[e][0].call(o.exports, function (n) {
var o = t[e][1][n];
return r(o || n)
}, o, o.exports)
@wellington1993
wellington1993 / worker.js
Created January 15, 2020 21:22
resource://devtools/client/shared/source-map/worker.js
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
(function () {
function t() {
var a = 0;
try {
a = r.performance.timing.navigationStart + Math.floor(r.performance.now())
} catch (b) {}
return 0 >= a || isNaN(a) ? (new Date).getTime() : a
}
function B(a, b) {