Skip to content

Instantly share code, notes, and snippets.

View danjesus's full-sized avatar
🏠
Working from home

Dan Jesus danjesus

🏠
Working from home
View GitHub Profile
document.addEventListener('DOMContentLoaded', function() {
setInterval(function() {
trocarTextDoTituloRandomicamente();
}, 500);
});
function trocarTextDoTituloRandomicamente() {
var meuTitulo = document.getElementsByClassName('meu-titulo');
var texto = meuTitulo[0].innerHTML;
@danjesus
danjesus / estilo.css
Created October 12, 2022 16:41
Formulário TI360
@import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
* {
font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
box-sizing: border-box;
}
body {
background-color: #68A357;
@import url('https://fonts.googleapis.com/css2?family=Poppins&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
* {
font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
img {
float: right;
}
const authProvider = {
login: () => {
return Auth.federatedSignIn({
provider: CognitoHostedUIIdentityProvider.Google,
})
},
checkError: (error:any) => { return Promise.resolve() },
checkAuth: async () => {
const session = await Auth.currentSession();
@danjesus
danjesus / widget.js
Created September 24, 2021 13:06
Zendesk Widget Configuration Options
//Show and hide
zE('webWidget', 'hide');
zE('webWidget', 'show');
zE('webWidget', 'clear');
zE('webWidget', 'toggle');
zE('webWidget', 'reset');
zE('webWidget', 'open');
//Click to show
// <a href="javascript:void(0);" id="showWidget" onclick="zE(function() {zE.show();});">Open widget on click</a>
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
@danjesus
danjesus / ofms.md
Created April 19, 2020 23:41 — forked from taion809/ofms.md
Observable F# Microservices

Observable FSharp Microservices (dotnetcore2.2+)

Let us define an observable microservice as one that exposes its internal state through events, metrics, and trace data. Ideally we can aggregate this data in some sort of centralized observability system for alerting and diagnostics. In my opinion there are tools that work much better than others and I will use those in this example but the most important part is that you have a starting point and your services can be observed and alerted on somehow. If your company does not have the means to setup all of this infrastructure you should consider buying one of the many SaaS options out today.

Disclaimer: I am not a native .net or F# developer, I think at this point in my career I've logged 2 weeks on an F# dev team so the implementations given below may not be idiomatic, however, my experience comes from being apart of both Devops and microservices dev teams in other teams and organizations.

That being said; let's start building an "observable" micro

@danjesus
danjesus / haproxy-www.tf
Created April 29, 2019 02:16 — forked from thisismitch/haproxy-www.tf
How To Use Terraform with DigitalOcean
resource "digitalocean_droplet" "haproxy-www" {
image = "ubuntu-14-04-x64"
name = "haproxy-www"
region = "nyc2"
size = "512mb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
connection {
@danjesus
danjesus / playlist.json
Last active January 27, 2019 20:06
Playlist
[
{
"videoId": "PMivT7MJ41M",
"endSeconds": 38,
"title": "Bruno Mars - That’s What I Like [Official Video]",
"artist": "Bruno Mars",
"restart": {
"videoId": "PMivT7MJ41M",
"startSeconds": 38,
"suggestedQuality": "large",
@danjesus
danjesus / docker-cleanup-resources.md
Created December 5, 2018 09:51 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm