Skip to content

Instantly share code, notes, and snippets.

View dlresende's full-sized avatar

Diego Lemos dlresende

View GitHub Profile
@dlresende
dlresende / manifest.yml
Created August 27, 2021 19:55
my-http-server BOSH manifest for CF Networking Onboarding
name: my-http-server
releases:
- name: "bpm"
version: "latest"
- name: "routing"
version: "latest"
- name: "nginx"
@dlresende
dlresende / gist:60b4c0240ad020a323ad
Last active March 20, 2021 19:51
FooBarQix Kata

FooBarQix Kata

Write a program that prints numbers from 1 to 100, one number per line. For each printed number, use the following rules:

  1. if the number is divisible by 3 or contains 3, replace 3 by "Foo";
  2. if the number is divisible by 5 or contains 5, replace 5 by "Bar";
  3. if the number is devisible by 7 or contains 7, replace 7 by "Qix".

Example: 1

Ruby

$ bundle gem $my_app -t rspec -b

Installing the local gem:

$ gem build $my_app.gemspec
$ gem install $my_app-<version>.gem
$ $my_app
@dlresende
dlresende / main.go
Created December 18, 2020 11:52
goroutine example with logging
package main
import (
"fmt"
"io"
"os"
"os/signal"
"sync"
)
uaac target https://pcf.$env.cf-app.com/uaa --skip-ssl-validation && uaac token owner get opsman pivotalcf -s ''
---
name: redis-on-demand-broker
releases:
- name: &broker-release ((broker_release))
version: latest
- name: &service-adapter-release ((service_adapter_release))
version: latest
- name: routing
version: latest
@dlresende
dlresende / why_om_ui_is_not_accessible.md
Last active October 20, 2018 12:07
Debug VirtualBox not correctly forwarding traffic on a multi-user machine

Problem

Cannot access OM running inside VirtualBox

Facts

box

  • The box has 2 interfaces one for each IP range
    eth0      Link encap:Ethernet  HWaddr 08:00:27:00:fb:33
              inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
    

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

@dlresende
dlresende / gist:274194dd6ec993eb5ec5
Last active September 6, 2018 10:06
RPN Calculator Kata

RPN Calculator Kata

A RPN calculator program computes expressions written in RPN (Reverse Polish Notation). A RPN expression (or a postfix expression) is one of the following:

  • a number X, in which case the value of the expression is that of X;
  • a sequence of the form E1 E2 O, where E1 and E2 are postfix expressions and O is an arithmetic operation; in this case, the value of the expression is that of E1 O E2

The following are RPN expressions:

@dlresende
dlresende / gist:dc57f506e1ab1de7e7df
Last active September 3, 2018 16:49
Tic Tac Toe Kata

Tic Tac Toe Kata

The rules of the tic tac toe game are the following:

  • a game is over when all fields are taken
  • a game is over when all fields in a column are taken by a player
  • a game is over when all fields in a row are taken by a player
  • a game is over when all fields in a diagonal are taken by a player
  • a player can take a field if not already taken
  • players take turns taking fields until the game is over
  • there are two player in the game (X and O)
### Keybase proof
I hereby claim:
* I am dlresende on github.
* I am dlresende (https://keybase.io/dlresende) on keybase.
* I have a public key ASCxCa7Jty9zqQzI9lGZcFWDaRCPUhCRa5jyi_imbXHyZQo
To claim this, I am signing this object: