Skip to content

Instantly share code, notes, and snippets.

View carlosspohr's full-sized avatar

Carlos Spohr carlosspohr

View GitHub Profile
@carlosspohr
carlosspohr / merge_git_repo_as_subdir
Created March 23, 2023 16:13 — forked from pauloperez/merge_git_repo_as_subdir
Merge one git repository into another repository as a sub-directory
git clone repo_main
git clone repo_sub
cd repo_main
git remote add repo_sub ../repo_sub
git fetch repo_sub
git checkout -b repo_sub repo_sub/master
mkdir dir_repo_sub
#/bin/bash
# @author Carlos Spohr
# Este script cria o bucket de produção e replicação na AWS juntamente da
# iam role, role policies para replicação.
# Para rodar este script você precisará ter o aws cli instalado e com uma chave(key)
# que permita você criar estes itens via aws cli.
# Este script é feito pra linux e depende apenas do pacote jq. Você pode instalar ele assim:
# CentOS: yum install -y jq
# Ubuntu/debian: apt-get install -y jq
yarn run v1.22.18
$ webpack
assets by status 1.04 MiB [cached] 86 assets
orphan modules 863 KiB [orphan] 249 modules
runtime modules 1.07 KiB 6 modules
built modules 2.05 MiB [built]
modules by path ../../node_modules/moment/locale/*.js 503 KiB 135 modules
modules by path ../../node_modules/@babel/runtime/helpers/*.js 6.89 KiB 16 modules
modules by path ../../node_modules/react-input-mask/ 14.3 KiB 2 modules
modules by path ../../node_modules/react-dom/ 119 KiB 2 modules
import React from 'react';
interface TabProps {
className?: string,
title: string;
isActive?: boolean;
onClick?: any;
}
interface TabState {
<Tabbed>
<Tab title={'Tab 1'} >
<p>Content 1</p>
</Tab>
<Tab title={'Tab 2'} >
<p>Content 2 </p>
</Tab>
</Tabbed>
@carlosspohr
carlosspohr / HowToUse.tsx
Created March 25, 2022 14:30
Basic tab component working, however, without handling of active tab.
<Tabs>
<Tab title="Aba 1">
Primeira aba
</Tab>
<Tab title="Aba 2">
Segunda aba
</Tab>
<Tab title="Aba 3" onTabChange={()=>{console.log('Vc clicou na aba 3')}}>
Terceira aba
</Tab>
@carlosspohr
carlosspohr / script-generate-tomcat-jks.sh
Created September 15, 2019 15:03
A simple script to add on crontab task scheduler for SSL certificates using Let's Encrypt.
#!/bin/bash
DOMAIN="www.your-domain.com.br.jks";
PASS="some-ssl-key-pass";
DNAME="CN=www.your-domain.com.br, O=Org name, L=CIty, ST=STATE, C=BR";
/bin/bash /usr/java/tomcat/bin/shutdown.sh
cd /usr/java/jdk1.8.0_121/bin
@carlosspohr
carlosspohr / AfterVraptor4Init.java
Last active September 19, 2018 23:43
Exemplo de como executar uma lógica qualquer logo depois da inicialização do VRaptor 4.
package br.inf.carlos.vraptor;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import org.apache.log4j.Logger;
import br.com.caelum.vraptor.events.VRaptorInitialized;
@ApplicationScoped
public class InitializationHandler {
private static final Logger logger = Logger.getLogger(InitializationHandler.class);
@carlosspohr
carlosspohr / dump-triggers.sql
Created August 23, 2018 13:30
How to dump only triggers and procedures/functions without table structure and data.
mysqldump -u root -p --no-data --routines --triggers -t your-database > triggers.sql
@carlosspohr
carlosspohr / uuid.sql
Created August 15, 2017 11:24
Instance of how to use uuids on Postgres.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
select uuid_generate_v4();
SELECT uuid_in(md5(random()::text || now()::text)::cstring);
create table teste (
id uuid not null primary key
);