Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
WFH

Elio Capelati Jr eliocapelati

🏡
WFH
View GitHub Profile
View definition.yaml
openapi: '3.0.0'
info:
title: API Teams
version: '1.0'
description: API for managing Teams
contact:
name: Elio Capelati Junior
email: eliocapelati@gmail.com
servers:
- url: 'http://localhost:8080/v1'
View principle-of-optimality.py
import time
def recursive_fib_memo(val, memo):
if val <= 1:
return val
elif val not in memo:
memo[val] = recursive_fib_memo(val - 2, memo) + recursive_fib_memo(val - 1, memo)
return memo[val]
@eliocapelati
eliocapelati / bluetooh_defibrillator.sh
Created Feb 18, 2021
Restart bluetooh service on Mac
View bluetooh_defibrillator.sh
#!/bin/bash
sudo launchctl stop com.apple.bluetoothd
sudo launchctl start com.apple.bluetoothd
View kubernetes_deployment_proble.yaml
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 5
periodSeconds: 20
readinessProbe:
@eliocapelati
eliocapelati / gist:b5a5b4ceed5cde209afe907d607b7e2a
Created Feb 2, 2019
Turn on show hidden files (like dotenv) in Finder.
View gist:b5a5b4ceed5cde209afe907d607b7e2a
defaults write com.apple.finder AppleShowAllFiles YES
@eliocapelati
eliocapelati / keybindings.json
Last active Dec 26, 2018
VSCODE Key Bind for UpperCase and LowerCase
View keybindings.json
[
{
"key": "cmd+t l",
"command": "editor.action.transformToLowercase",
"when" : "editorTextFocus"
},
{
"key": "cmd+t u",
"command": "editor.action.transformToUppercase",
"when" : "editorTextFocus"
@eliocapelati
eliocapelati / lastfm.py
Last active Jun 15, 2018
Usage: $ python3 lastfm_cli.py username
View lastfm.py
import requests
from requests import Session
import json
from pprint import pprint
import os
import sys
class Lastfm:
url = 'http://ws.audioscrobbler.com/2.0/'
View timezonelist.txt
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
@eliocapelati
eliocapelati / logback-spring.xml
Created Nov 16, 2017 — forked from thomasdarimont/logback-spring.xml
logback+graylog spring configuration example
View logback-spring.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} [%X{svc_usr}]%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<contextName>test</contextName>
View lastMonthsFormated.js
Array.from({length: 5}, (v, k) => moment().subtract(k, 'month').format("MM/YYYY"));