Skip to content

Instantly share code, notes, and snippets.

View carloscarucce's full-sized avatar
:octocat:

Carlos Alberto Bertholdo Carucce carloscarucce

:octocat:
View GitHub Profile
@carloscarucce
carloscarucce / code-commit-rename-repos.sh
Created June 14, 2024 12:38
Renames all repositories in AWS code commit using awscli + jq
#!/bin/bash
PROFILE=my-profile
REGION=us-east-1
CODE_REPOSITORIES=$(aws codecommit list-repositories --no-paginate --profile=$PROFILE --region=$REGION |jq -r .repositories[].repositoryName)
for REPO in $CODE_REPOSITORIES; do
NEW_REPO_NAME="${REPO}_deprecated"
echo "- Reponame: ${REPO}; New name: ${NEW_REPO_NAME}"
@carloscarucce
carloscarucce / gh-add-repos-to-team.sh
Last active June 12, 2024 18:56 — forked from narze/gh-add-repos-to-team.sh
Add repos to team with gh
#!/bin/bash
PERMISSION="push" # Can be one of: pull, push, admin, maintain, triage
ORG="orgname"
TEAM_SLUG="your-team-slug"
# Get names with `gh repo list orgname`
# Change "limit" if necessary
gh repo list $ORG --limit 1000 --json name --json owner -q '.[] | "\(.owner.login)/\(.name)"' | while read -r REPO; do
echo "Repo: ${REPO}\r\n"
@carloscarucce
carloscarucce / composer-install-update.sh
Last active April 3, 2024 02:21
Determines whenever to run install, update or simply skip...
#!/bin/sh
# @author: Carlos A. Bertholdo Carucce
# <https://github.com/carloscarucce>
if [[ ! -f "composer.json" ]]; then
echo "[Composer] composer.json was not found" >&2
exit 1;
fi
@carloscarucce
carloscarucce / tabela.blade.php
Last active November 24, 2022 12:58
Exemplo de tabela dinamica (Javascript)
<!DOCTYPE html>
<html>
<head>
<title>Exemplo Ajax</title>
</head>
<body>
<form action="{{ url('salvar') }}" method="post">
@csrf
<button type="button" id="btn_add">Adicionar</button>
<table id="partes">
@carloscarucce
carloscarucce / autotab.js
Last active June 9, 2022 19:01
Auto tab between N fields.
(function(){
/**
* Focus on the next input
*
* @param current
* @param to
*
* @see https://bartamediagroup.com/auto-tab-html-input-fields/
*/
function tab(current,to){
@carloscarucce
carloscarucce / start.bat
Last active December 28, 2021 15:57
Init php built-in server
php -S localhost:8000 -t htdocs
<?php
//PHP 8+
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Route
{
public function __construct(
public string $path,
public ?string $method = null,
@carloscarucce
carloscarucce / sha256.js
Created October 29, 2020 22:58
Javascript SHA256 hashing
/**
*
* Secure Hash Algorithm (SHA256)
* http://www.webtoolkit.info/
*
* Original code by Angel Marin, Paul Johnston.
*
**/
function sha256(s) {
var chrsz = 8;
@carloscarucce
carloscarucce / treino.cfg
Created August 25, 2020 14:05
comandos treino para CSGO
sv_cheats 1
bot_kick
sv_infinite_ammo 1
ammo_grenade_limit_total 5
sv_grenade_trajectory 1
sv_grenade_trajectory_time 10
sv_showimpacts 1
mp_buytime 9999
mp_buy_anywhere 1
sv_regeneration_force_on 1
@carloscarucce
carloscarucce / node-https-request.js
Last active April 14, 2020 14:01
Node https request example
const https = require('https');
/**
* Make a request
* @param {Object} options
* @param {Object|string} data
*/
const requestSSL = (options, requestData = null) => new Promise((resolve, reject) => {
// eslint-disable-next-line consistent-return