Skip to content

Instantly share code, notes, and snippets.

View tykoth's full-sized avatar
🏠
Working from home

Thiago Bocchile tykoth

🏠
Working from home
View GitHub Profile
@tykoth
tykoth / art.md
Created June 5, 2020 00:37
An awesome pixel art chef d'oeuvre
@tykoth
tykoth / .block
Created May 5, 2020 14:04
fresh block
license: mit
@tykoth
tykoth / git-log-all-to-csv
Created December 3, 2019 08:57
[Fetch all git logs to csv]
# PARTE 1 - LOOP NOS DIRETÓRIOS ONDEM TEM OS REPOSITÓRIOS
for target in *.git
do
printf "$target indexing..."
git -C $target log --date=iso --all \
--pretty=format:"%x40%x40%x22tykoth/$target%x22%x2C%x22%h%x22%x2C%x22%an%x22%x2C%x22%ad%x22%x2C%x22%s%x22%x2C" \
--shortstat | tr "\n" " " | sed -e 's/@@"/\n"/g' > commit-$target.csv
echo "$target indexed"
@tykoth
tykoth / php-namespace-rename.sh
Created November 30, 2019 20:03
[Replace para classes em PHP com grep e sed]
#!/bin/bash
#
# Procura dentro do diretório atual arquivos com o termo que eu quero substituir
# Lista e ja renomeia o padrão de arquivos (php psr-4).
# (faltou renomear views.blade)
# No mesmo pipe ja renomeia o termo em Camelcase e lowercase
# (todo: plural camel case > plural lowercase > singular camel case > singular lower case)
grep -Er '[Ee]ngine' . | cut -d: -f1 | sort -u | sed -Ee "h;g;s/(.*)(Engine)(.*)/mv \0 \1Core\3/e;" | xargs -I{} sed -i "s/Engine/Core/g;s/engine/core/g" {}
@tykoth
tykoth / mass-az-create-repos.sh
Created November 26, 2019 15:21
[mass-az-create-repos] Escaneia seu workspace, cataloga os diretórios que não tem repositório no seu azure devops e retorna o conteúdo de um shellscript que cria repositório no azure, entra na pasta, adiciona o remote "azure" e da "git push --all" #mass #azure #git
#!/bin/bash
# YES
# The given dir: /lab/
# tentativas, que fiquem, vão ser úteis.
#find . -maxdepth 1 -type d -printf '%f\n'
#find . -name .git -type d -prune
#find . -type d -execdir test -d {}/.git \; -print -prune
@tykoth
tykoth / azure-pipelines.yml
Created November 25, 2019 09:45 — forked from zanechua/azure-pipelines.yml
Azure Pipeline + Laravel + MySQL + PHPUnit + Laravel Dusk
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 16.04'
variables:
phpVersion: 7.2
@tykoth
tykoth / formatDate.js
Created August 3, 2016 21:24 — forked from cstipkovic/formatDate.js
A simple format Date function using Javascript prototype
/*
Based on Rick Strahl code
http://www.west-wind.com/weblog/posts/2008/Mar/18/A-simple-formatDate-function-for-JavaScript
Contributors:
Clauber Stipkovic - @clauberhalic
Mário Rinaldi - @MarioRinaldi
*/
Date.prototype.formatDate = function (format) {
// LoadingScreenManager
// --------------------------------
// built by Martin Nerurkar (http://www.martin.nerurkar.de)
// for Nowhere Prophet (http://www.noprophet.com)
//
// Licensed under GNU General Public License v3.0
// http://www.gnu.org/licenses/gpl-3.0.txt
using UnityEngine;
using UnityEngine.UI;