Skip to content

Instantly share code, notes, and snippets.

View jorgelbg's full-sized avatar
:octocat:
coding

Jorge Luis Betancourt jorgelbg

:octocat:
coding
View GitHub Profile
@jorgelbg
jorgelbg / cleanshot.json
Created May 17, 2023 13:23
Remap the screenshot key to cmd+shift+8 (mapped to use Cleanshot)
{
"title": "Maps Screenshot key to another tool",
"rules": [
{
"description": "Screenshot to another tool",
"manipulators": [
{
"from": {
"key_code": "4",
"modifiers": {
@jorgelbg
jorgelbg / pkg-go-dev-sourcegraph.js
Last active May 17, 2023 10:35
UserScript for rewriting pkg.go.dev links to always use sourcegraph.com
// ==UserScript==
// @name pkg.go.dev links to sourcegraph
// @namespace https://jorgelbg.me/
// @version 0.1
// @description Translate all the cs.opensource.google and github.com links to sourcegraph.com on pkg.go.dev.
// @author Jorge Luis Betancourt <github@jorgelbg.me>
// @match https://pkg.go.dev/*
// @icon https://sourcegraph.com/.assets/img/sourcegraph-mark.svg
// @require https://openuserjs.org/src/libs/sizzle/GM_config.js
// @grant GM_getValue
listenAddress:
type: "config"
value: "0.0.0.0:7201"
metrics:
scope:
prefix: "coordinator"
prometheus:
handlerPath: /metrics
listenAddress: 0.0.0.0:7203 # until https://github.com/m3db/m3/issues/682 is resolved
2019-03-26T12:55:14.309Z INFO tracing disabled; set `tracing.backend` to enable
12:55:14.310934[I] resolving seed node configuration [{hostID m3db_local} {seedNodeHostIDs [m3db_local]}]
12:55:14.310961[I] seed node, starting etcd server
2019-03-26T12:55:14.382Z INFO resolved cluster namespace {"namespace": "default"}
2019-03-26T12:55:14.805Z INFO no m3msg server configured
2019-03-26T12:55:14.805Z INFO starting server {"address": "0.0.0.0:7201"}
12:55:14.927798[W] max index query IDs concurrency was not set, falling back to default value
12:55:14.928240[W] host doesn't support HugeTLB, proceeding without it
12:55:14.963796[I] bytes pool registering bucket capacity=842356182384, size=842356182392, refillLowWatermark=%!f(*float64=0x242a4d8), refillHighWatermark=%!f(*float64=0x242a4d0)
12:55:14.963837[I] bytes pool registering bucket capacity=842356182400, size=842356182408, refillLowWatermark=%!f(*float64=0x242a4d8), refillHighWatermark=%!f(*float64=0x242a4d0)
@jorgelbg
jorgelbg / full-example-watcher-ml-alert.json
Created March 15, 2019 14:57
Full example on a generic elastic Watcher alert
{
"trigger": {
"schedule": {
"interval": "5m"
}
},
"input": {
"chain": {
"inputs": [
{
@jorgelbg
jorgelbg / slack-black.js
Created October 5, 2018 16:17
Slack black theme (inlined) from https://github.com/widget-/slack-black-theme/. Also applied a couple of fixes to work with Slack 3.3.3 (tested)
// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {
// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");
// Fetch our CSS in parallel ahead of time
const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';
let cssPromise = fetch(cssPath).then(response => response.text());
@jorgelbg
jorgelbg / query.json
Created August 15, 2018 09:13
Full ES query
{
"version": true,
"size": 500,
"sort": [
{
"@timestamp": {
"order": "desc",
"unmapped_type": "boolean"
}
}
@jorgelbg
jorgelbg / after.json
Created March 6, 2018 12:17
After network-fix patch
"filters": [
{
"id": "30d0e7db5b1bce5f7c9d78ba6b08980b6778fd41e63bc4cb378affccde3670ad",
"events": {
"duration_in_millis": 35,
"in": 24400,
"out": 24400
},
"name": "cidr"
},
@jorgelbg
jorgelbg / before.json
Created March 6, 2018 12:15
Before network-fix patch
"filters": [
{
"id": "30d0e7db5b1bce5f7c9d78ba6b08980b6778fd41e63bc4cb378affccde3670ad",
"events": {
"duration_in_millis": 29,
"in": 24400,
"out": 24400
},
"name": "cidr"
},
fetching: https://it.wikipedia.org/wiki/Unix
parsing: https://it.wikipedia.org/wiki/Unix
contentType: text/html
tstamp : 2017-11-29T10:45:24.882Z
digest : 1226174fcd8c5676aa3e2396ef7a750d
host : it.wikipedia.org
id : https://it.wikipedia.org/wiki/Unix
title : Unix - Wikipedia
url : https://it.wikipedia.org/wiki/Unix
content : Unix - Wikipedia