Skip to content

Instantly share code, notes, and snippets.

View barata0's full-sized avatar

Daniel Ribeiro barata0

  • Rio de Janeiro
View GitHub Profile
@barata0
barata0 / get_commits_and_tags.sh
Created October 27, 2023 13:49
get commit logs and tags from git repos
#!/bin/bash
# arquivo repos.txt com listagem dos repos a serem processados
mapfile -t repos < repos.txt
since=${1:-'01 Jan 2022'}
echo "--------- repos since ${since}"
echo $repos
echo "--------------------------"
@barata0
barata0 / ignore_ssl.groovy
Created December 13, 2016 21:08
Ignore SSL certs in groovy
def nullTrustManager = [
checkClientTrusted: { chain, authType -> },
checkServerTrusted: { chain, authType -> },
getAcceptedIssuers: { null }
]
def nullHostnameVerifier = [
verify: { hostname, session ->
//true
hostname.startsWith('yuml.me')
@barata0
barata0 / Dockerfile
Created January 31, 2023 17:47
docker-compose dev with same user and group as host
FROM golang:1.19
RUN apt-get update && apt-get -y install sudo
# get args from docker-compose args: or docker build --build-arg
ARG UNAME
ARG GNAME
ARG UID=1000
ARG GID=1000
@barata0
barata0 / video-playback-reverse.html
Created December 6, 2017 02:19
html5 video with positive and negative playbackrates (jog, shuttle and seeking)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<title>HTML5 backward playback Video</title>
</head>
<body>
<div>
<video id='video'
width="360"
@barata0
barata0 / bump.js
Created November 5, 2021 16:53
bump openapi version javascript
const yaml = require('js-yaml');
const fs = require('fs');
const bump = (filename) => {
try {
const doc = yaml.load(fs.readFileSync(filename, 'utf8'));
const version = doc.info.version.split('.').map(a => parseInt(a));
console.log('openApi from', version)
version[2]++
console.log('openApi to ', version)
@barata0
barata0 / mycustomlayout
Last active August 12, 2021 10:46
xkb symbols para teclado de laptop ABNT2 ficar parecido com US INTERNATIONAL
// file:/usr/share/X11/xkb/symbols/mycustomlayout
default partial alphanumeric_keys
xkb_symbols "mycustomlayout" {
// Based on a very simple Brazilian modified ABNT2 keyboard,
// by Daniel Ribeiro (danieltribeiro@gmail.com).
// With added support for dead keys in I18N applications,
// by Conectiva (http://www.conectiva.com.br).
// the idea is to have almost the us-international with cedil
@barata0
barata0 / vue.global.js
Created November 11, 2019 01:53
vue 3 global js vue next preview
var Vue = (function (exports) {
'use strict';
// Make a map and return a function for checking if a key
// is in that map.
//
// IMPORTANT: all calls of this function must be prefixed with /*#__PURE__*/
// So that rollup can tree-shake them if necessary.
function makeMap(str, expectsLowerCase) {
const map = Object.create(null);
@barata0
barata0 / index.js
Last active August 19, 2019 13:21
cors-proxy reverse-proxy add http headers nodejs node javascript
'use strict'
const express = require('express');
const request = require('request');
const URL = require('url').URL;
const app = express();
const allowedMethods = 'GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS' // os metodos permitidos
const allowedHeaders = 'Authorization,Content-Type,Accept,X-Amz-Date,X-Api-Key,X-Amz-Security-Token' // os headers permitidos
// const allowedHeaders = 'Accept, Accept-CH, Accept-Charset, Accept-Datetime, Accept-Encoding, Accept-Ext, Accept-Features, Accept-Language, Accept-Params, Accept-Ranges, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, Access-Control-Allow-Methods, Access-Control-Allow-Origin, Access-Control-Expose-Headers, Access-Control-Max-Age, Access-Control-Request-Headers, Access-Control-Request-Method, Age, Allow, Alternates, Authentication-Info, Authorization, C-Ext, C-Man, C-Opt, C-PEP, C-PEP-Info, CONNECT, Cache-Control, Compliance, Connection, Content-Base, Content-Disposition, Content-Encoding, Content-ID, Content-Language, Content-Length, C
@barata0
barata0 / FruitNeo4jSyncService.java
Created August 15, 2019 18:50
Quarkus fruit neo4j sync service
package org.acme.neo4j;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.neo4j.driver.Driver;
import org.neo4j.driver.Session;
@barata0
barata0 / parseSTLSubtitle.groovy
Created March 22, 2019 14:05
Parse STL Subtitle
// https://mvnrepository.com/artifact/fr.noop/charset
@Grapes(
@Grab(group='fr.noop', module='charset', version='1.0.1')
)
import static fr.noop.charset.CharsetProvider.*;
def f = new File('C:/Users/danielr/Desktop/legendas/AMERICANHORRORSTORY_6ATS01_ORIG_V473377_INT_C_TVD_SUBFULSTL_29_BPO_178_MOS-XX_RT004242.stl')