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
@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 / 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

@danjesus
danjesus / lod.md
Created March 19, 2018 01:03 — forked from nelsonsar/lod.md
Explicação Law of Demeter

Law of Demeter

Motivação

Diminuir o acomplamento entre objetos.

Como?

A lei sugere que objetos só podem falar com seus "amigos" e não com "estranhos". Essa ideia faz com que um objeto não conheça a estrutura interna de outro objeto e, se por um caso surja essa necessidade a API deve ser modificada para evitar que isso aconteça.

@danjesus
danjesus / supervisor.conf
Created May 16, 2017 17:44 — forked from tsabat/supervisor.conf
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@danjesus
danjesus / ultimate-ut-cheat-sheet.md
Created September 21, 2016 17:22 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@danjesus
danjesus / replify
Created August 26, 2016 21:25 — forked from danielrw7/ replify
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"