Skip to content

Instantly share code, notes, and snippets.

View brunosaboia's full-sized avatar

Bruno Saboia de Albuquerque brunosaboia

View GitHub Profile

Keybase proof

I hereby claim:

  • I am brunosaboia on github.
  • I am brunosaboia (https://keybase.io/brunosaboia) on keybase.
  • I have a public key ASAZILcgCfrPFZ_TT2o7axCnagVh8Qh8M94QfXfWV-lZwQo

To claim this, I am signing this object:

FROM node:14.8.0-stretch
ENV APPLICATION_DIR=/usr/src/app
ENV RETENTION_DAYS=7
ENV PORT=7777
ENV PATH="${APPLICATION_DIR}:${PATH}"
RUN mkdir -p ${APPLICATION_DIR} && \
chown node:node ${APPLICATION_DIR}
use std::str::FromStr;
struct ParseError<'a, E> {
error: E,
source: &'a str,
}
fn parse<'a, T: FromStr>(s: &'a str) -> Result<T, ParseError<'a, T::Err>> {
s.parse().map_err(|e| ParseError { error: e, source: s })
}
Lately having escaped three-kinded death
Not by evasion but by coming through
I celebrate what may be true beginning.
But new begun am most without resource
Stupid and stopped.
How do the newborn grow? I am of them.
Freshness has taken our hearts;
Pain strips us to the source, infants of further life
Waiting for childhood as we wait for form.
@brunosaboia
brunosaboia / clooney.py
Created January 5, 2018 05:53
Python script to clone all repos from a given Bitbucket team
# -*- coding: utf-8 -*-
"""
coinify-tools
clooney
~~~~~~~~~~~~
Little script to clone all repos from a given BitBucket team/user.
:author: Bruno Saboia de Albuquerque <bsa@coinify.com>
@brunosaboia
brunosaboia / clone_all_bitbucket.sh
Created January 5, 2018 05:48
Bash one-liner script to clone all repos from a Bitbucket team
for repo in $(curl -u {username} --raw https://api.bitbucket.org/1.0/users/{team} | sed -r 's/("name": )/\n\1/g' | sed -r 's/"name": "(.*)"/\1/' | sed -e 's/{//' | cut -f1 -d\" | tr '\n' ' '); do git clone git@bitbucket.org:{team}/$repo.git; done
@brunosaboia
brunosaboia / function.r
Created October 1, 2015 13:38
A function to remove the RF from the Stocks
remove_risk_free <- function(stocks, risk_free, rf_col_name) {
if(class(risk_free) != class(timeSeries()) || class(stocks) != class(timeSeries())) {
stop("The two first parameters must be timeSeries objects")
}
if(nrow(risk_free) != nrow(stocks)) {
stop("The two time series must be from the same size")
}
ret <- stocks[,1]
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 0x84:
base.WndProc(ref m);
if ((int)m.Result == 0x1)
m.Result = (IntPtr)0x2;
return;
}
@brunosaboia
brunosaboia / Post4-3.cs
Created September 13, 2013 20:55
Salvar o nome no XData
[CommandMethod("SalvarNome")]
static public void SalvarNome()
{
var documento = Application.DocumentManager.MdiActiveDocument;
var editor = documento.Editor;
var nomeApp = "AppTesteXData";
var opcoesNome = new PromptStringOptions("\nDigite um nome para a entidade: ");
opcoesNome.AllowSpaces = true;
var resultadoNome = editor.GetString(opcoesNome);
@brunosaboia
brunosaboia / Post4-2.cs
Created September 13, 2013 20:22
Registrando a app na tabela
static void RegistrarApp(string nome)
{
var documento = Application.DocumentManager.MdiActiveDocument;
var banco = documento.Database;
using (var transacao = documento.TransactionManager.StartTransaction())
{
var tabela = transacao.GetObject(banco.RegAppTableId, OpenMode.ForRead, false) as RegAppTable;