Skip to content

Instantly share code, notes, and snippets.

View alexandrebl's full-sized avatar
🛰️
Working from space

ABrandaoL alexandrebl

🛰️
Working from space
View GitHub Profile
swagger: "2.0"
info:
description: "A healthcheck Example"
title: "Endpoints Example"
version: "1.0.0"
host: "healthcheck.endpoints.beta000.cloud.goog"
consumes:
- "application/json"
produces:
- "application/json"
@ferreirafa
ferreirafa / RecuperacaoClusterRabbitmq.txt
Created September 6, 2018 22:33
--- Recuperação do Cluster do Rabbitmq após quebra de um nó ---
--- Recuperação do Cluster do Rabbitmq após quebra de um nó ---
1 - Acessar a interface de gerenciamento do cluster e identificar o nó que quebrou.
2 - Acessar a console de um nó que ainda esteja ativo no cluster:
2.1 - Promover o usuário a root:
sudo su
SELECT @@SERVERNAME as ServerName,
OBJECTNAME = OBJECT_NAME(I.OBJECT_ID),
INDEXNAME = I.NAME,
I.INDEX_ID,
S.*
FROM
SYS.INDEXES I
INNER JOIN SYS.OBJECTS O
ON I.OBJECT_ID = O.OBJECT_ID
INNER JOIN SYS.DM_DB_INDEX_USAGE_STATS S
@anckizes
anckizes / DependencyInjection.md
Last active October 16, 2017 19:19
Dependency Injection

Pra começar: O que é injeção de dependencia?

"Hollywood Principle:" Don't Call Us, We'll Call You.

Exemplo na vida real: Você precisa ir ao mercado. Para executar esta tarefa suas dependências são:

  • Verificar se há água no carburador do carro suficiente para o trajeto;
  • Verificar num mapa o trajeto mais curto;
  • Ouvir na rádio local se há algum impedimento no caminho;
  • Montar a lista de compras;
@yetanotherchris
yetanotherchris / google-cloud-pubsub-example.cs
Last active January 24, 2025 22:04
Google Cloud Pub/Sub C# example
//
// Google Cloud Pub/Sub C# example
// NOTE: This is a .NET Core 1.1 console app.
// Use "dotnet run" to run it, run setup.ps1 first.
//
using System;
using System.Collections.Generic;
using Google.Cloud.PubSub.V1;
using Google.Protobuf;
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active October 31, 2025 17:15 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@mvrmoreira
mvrmoreira / DbSetMock.cs
Last active August 29, 2015 14:20
DbSetMock
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
namespace Billing.Tests.Models
{
public class DbSetMock<T> : DbSet<T>, IQueryable, IEnumerable<T>
# import libraries
import time
import os
while True: # do forever
os.system('fswebcam -r 320x240 -S 3 --jpeg 50 --save /home/pi/to_transmit/%H%M%S.jpg') # uses Fswebcam to take picture