Skip to content

Instantly share code, notes, and snippets.

View edersonbadeca's full-sized avatar
💭
Creating a better world line by line

Ederson Badeca edersonbadeca

💭
Creating a better world line by line
View GitHub Profile
@edersonbadeca
edersonbadeca / badwolf.itermcolors
Created May 10, 2023 13:32 — forked from mattijs/badwolf.itermcolors
badwolf iTerm2 colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.07884746789932251</real>
<key>Green Component</key>
<real>0.081504985690116882</real>
@edersonbadeca
edersonbadeca / deploy-per-hour.py
Created June 16, 2022 16:57
calculate deploy per hour dora metrics
# coding: utf-8
# This sample code shows how to create a timeseries based on date periods to calculate
# the frequency that an event occurs in a hour.
# Links:
# - https://pandas.pydata.org/docs/reference/api/pandas.date_range.html
# - https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html?highlight=resample#resample-a-time-series-to-another-frequency
import pandas as pd
import numpy as np
@edersonbadeca
edersonbadeca / checkInputNumber.js
Created March 18, 2022 18:03
Check if the input value in between the attribute props
document.querySelectorAll('input[type=number]').forEach(input => {
input.addEventListener('change', (e) => {
const value = e.target.value
const props = e.srcElement.attributes
console.log(`${props.min.value} ${props.max.value} ${value}`)
if (value <= props.min.value || value >= props.max.value) {
alert('valor muito baixo')
}
})
})
@edersonbadeca
edersonbadeca / pomodoro
Created March 16, 2022 14:54
Pomodoro for macbook
to displayError()
display dialog "The script encountered a problem."
end displayError
set rightNow to (get current date)
set hoursNow to hours of rightNow
try
repeat while true
#display dialog hoursNow
if (hoursNow > 17) then
@edersonbadeca
edersonbadeca / water
Created March 16, 2022 14:53
Water reminder - mac script
try
repeat while true
say "Drink water now"
delay 300
end repeat
end try
@edersonbadeca
edersonbadeca / datediff.py
Created March 14, 2022 17:33
Python date diff
# coding: utf-8
d = date(2022, 2, 22)
d1 = date(2022, 3, 4)
abs(d-d1).days
@edersonbadeca
edersonbadeca / stop-execution-chain.js
Created January 30, 2022 13:09
Sometimes we need to stop a iteration
function Stop(r) {
function Reason () { throw new Error(r) }
return Reason
}
function StopChain(r, fn) {
return fn(r)
}
const error = StopChain('NOT_FOUND', Stop)
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: "*"
workflow: tests
workflows:
_tests_setup:
steps:
- activate-ssh-key: {}
// Example of pipeline process written in kotlin
fun multiplyIt(x:Int): Int {
println(x * 2)
return x * 2
}
fun plusTwo(x: Int): Int {
println(x + 2)
return x + 2
}
@edersonbadeca
edersonbadeca / python-es6-comparison.md
Created December 6, 2018 16:26 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math