Skip to content

Instantly share code, notes, and snippets.

View engividal's full-sized avatar
🥶

Ismael Vidal engividal

🥶
  • Escola Superior de Tecnologia
  • Manaus-AM
View GitHub Profile
<?php
$metodoHttp = $_SERVER['REQUEST_METHOD'];
if ($metodoHttp == 'POST')
{
$urltoken = 'https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=';
$token = $_POST['idToken'];
$url = $urltoken.$token ;
@engividal
engividal / readingAndWriting.java
Created October 3, 2018 02:10
Funções para salvar arquivos no android
// Função para leitura do Arquivo
private void read(FileInputStream fis) throws IOException {
BufferedReader reader = new BufferedReader(
new InputStreamReader(fis));
StringBuilder sb = new StringBuilder();
String linha;
while ((linha = reader.readLine()) != null) {
if (sb.length() != 0) sb.append('\n');
sb.append(linha);
}
@engividal
engividal / fake_keyboard.py
Last active March 26, 2020 00:18
I use this gist when need to maintain the connection on google codelab for a long time. Is necessary to install the library pynput(https://pypi.org/project/pynput/) and run in Python.
# -*- coding: utf-8 -*-
"""
Spyder Editor
Maintain the connection on google codelab google for a long time. write in google cell at random time between 1 and 100 seconds.
"""
from pynput.keyboard import Key, Controller
import time
import random
@engividal
engividal / check_cpu.ipynb
Created February 29, 2020 16:12
This code check whether GPU is being or not
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@engividal
engividal / screenrc
Created September 29, 2021 14:35
config screen terminal
# File: ~/.screenrc
#
# Deactivate the startup message of screen
startup_message off
# Create 2x2 screens
split
split -v
focus down
@engividal
engividal / Dockerfile
Created October 26, 2022 11:57
Docker image to build Android AOSP
# syntax=docker/dockerfile:1
#
# Docker image to build Android AOSP
#
FROM ubuntu:18.04
# Dependency required on Android docs
RUN apt-get update && apt-get install -y git-core \
gnupg flex bison build-essential zip curl zlib1g-dev \
gcc-multilib g++-multilib libc6-dev-i386 libncurses5 \
@engividal
engividal / download_script.py
Last active December 20, 2023 14:34
The download script is a Python program that helps you estimate the time it will take to download a file of a certain size. It does so by monitoring the current size of the downloaded file and updating a progress bar accordingly. The progress bar is displayed in the command-line interface using the tqdm library. To use the script, you need to pr…
import argparse
import time
import subprocess
from tqdm import tqdm
parser = argparse.ArgumentParser(description='Download script.')
parser.add_argument('path', type=str, help='Path to the file to be downloaded.')
parser.add_argument('size', type=float, help='Size of the file to be downloaded in GB.')
args = parser.parse_args()