Skip to content

Instantly share code, notes, and snippets.

View robsonpiere's full-sized avatar
💻
Coding, cycling, swimming, running...

Robson Piere robsonpiere

💻
Coding, cycling, swimming, running...
View GitHub Profile
@robsonpiere
robsonpiere / rename.py
Last active October 16, 2021 05:48
Renomear arquivos em python
import os
# exemplo alterado de EX_10.5.py para 10_5.py
for nome in os.listdir('./arquivos'):
# alterar conforme sua necessidade de geração de nomes e layout de arquivos
dados = str(nome).split(".")
numero = dados[0].split("_")[1]
subnumero = dados[1]
novo_nome = numero + "_" + subnumero + ".py"
@robsonpiere
robsonpiere / listar.py
Last active September 1, 2021 15:32
Listar pastas / subpastas python Recursivo
import os
pastas = os.listdir()
total = 0
arq = open("lista_de_arquivos.txt", "w",encoding="utf-8")
def listar_pasta(pasta):
tot = 0
subpastas = list()
if os.path.isdir(pasta):
items = os.listdir(pasta)
@robsonpiere
robsonpiere / prints.py
Last active June 24, 2017 15:10
Printscreen em python
import pyscreenshot as ImageGrab
def main():
imagens = []
# captura todas as imagens primeiro e deixa na memória
for i in range(10):
imagens.append(ImageGrab.grab())
print("captura:" + str(i))
https://scotch.io/tutorials/angularjs-multi-step-form-using-ui-router
@robsonpiere
robsonpiere / MY_Model.php
Last active August 16, 2018 19:26
Execute Stored Procedure - MSSQL - Codeignaiter 3
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Model extends CI_Model
{
public function __construct()
{
parent::__construct();
}
@robsonpiere
robsonpiere / launch.json
Last active November 29, 2018 16:47
Debug ionic in vsCode
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Executar o Chrome contra localhost",
"url": "http://localhost:8100",
"sourceMaps": true,
"webRoot": "${workspaceFolder}/www"
@robsonpiere
robsonpiere / reinicia_servico.bat
Created December 7, 2018 10:24
Scripts Utéis para Windows Server
@Echo Off
Set ServiceName=MySQL57
SC queryex "%ServiceName%"|Find "STATE"|Find /v "RUNNING">Nul&&(
echo %ServiceName% Fora do AR
echo Start %ServiceName%
Net start "%ServiceName%">nul||(
Echo "%ServiceName%" não pode ser iniciado
exit /b 1
)
@robsonpiere
robsonpiere / index.html
Last active May 8, 2023 21:04
Exemplo simples da API de validação do javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="script.js" defer></script>
</head>
@robsonpiere
robsonpiere / highlight-blockquote.md
Last active December 26, 2023 21:13
Testing An option to highlight a "Note" and "Warning" using blockquote

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

[!WARNING]

@robsonpiere
robsonpiere / code.ipynb
Created November 14, 2023 22:35
Compression challenge
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.