Skip to content

Instantly share code, notes, and snippets.

View nicolas-oliveira's full-sized avatar
🌎
Everyone has something to share

Nicolas Oliveira nicolas-oliveira

🌎
Everyone has something to share
  • Work in Zenvia
  • Live in Brazil
View GitHub Profile
#!/bin/bash
# Absolute path to xrandr
TARGET_WIDTH=${TARGET_WIDTH:-2560}
TARGET_HEIGHT=${TARGET_HEIGHT:-1440}
POSITION="right"
XRANDR="/usr/bin/xrandr"
# NVIDIA="$(nvidia-settings -q CurrentMetaMode -t)"
LAPTOP=$($XRANDR | awk '/ connected/ && /eDP/{print $1}')
#!/usr/bin/env bash
# Source: https://github.com/Silejonu/bash_loading_animations
# shellcheck disable=SC2034 # https://github.com/koalaman/shellcheck/wiki/SC2034
### Loading animations list ###
# The first value of an array is the interval (in seconds) between each frame
## ASCII animations ##
package utils
// Função que calcula a raiz quadrada de um número `x`
// utilizando uma abordagem iterativa.
func Sqrt(x float64) float64 {
// `z` é o valor inicial da raiz aproximada. Começa em 1.0.
var z float64 = 1.0
// Loop que vai de 1 até o valor de `x`, realizando iterações com incrementos de 1.0.
for i := 1.0; i < x; i++ {
@nicolas-oliveira
nicolas-oliveira / 0_reservados.md
Last active October 4, 2024 17:12
Bash Script Documentação e sintaxe completa

Principais Chaves Reservadas no Bash e Exemplos

Chave Descrição Exemplo
$@ Expande todos os argumentos passados ao script como uma lista separada. Útil para loops. for arg in "$@"; do echo $arg; done – Itera sobre todos os argumentos passados ao script.
$* Expande todos os argumentos passados ao script como uma única string. `
@nicolas-oliveira
nicolas-oliveira / show.sh
Last active September 24, 2024 19:24
Get .git subfolders from any folder and more metadata
#!/bin/bash
PWD="$(pwd)"
stat_mod=""
stat_created=""
stat_perm=""
stat_size=""
echo -e "\n\e[1m SHOW COMMAND\n"
function start_loading() {
local pid=$1
@nicolas-oliveira
nicolas-oliveira / aliases.md
Created September 19, 2024 22:46
Aliases in git

Aliases for git


git delete-local
git aliases
git url

Better log

usage:

#include <math.h>
#include <stdio.h>
#include <string.h>
#ifndef _WIN32
#include <unistd.h>
#else
#include <windows.h>
void usleep(__int64 usec)
{
HANDLE timer;
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import CrawlerService from '../domain/entities/crawler/crawler.service';
import PeopleInfo from './dtos/PeopleInfo.dto';
import formatDate from './utils/formatDate';
import { TimeoutError } from 'puppeteer';
interface RequestProps {
checkin: string;
checkout: string;
}

Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)

This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software

on an Ubuntu Linux system, in particular Ubuntu 20.04.

@nicolas-oliveira
nicolas-oliveira / hdmi_tweaks.sh
Created March 5, 2024 16:02
script to manipulate font size and icons size with two monitors with different size but 1080p
#!/bin/bash
# Absolute path to xrandr
XRANDR="/usr/bin/xrandr"
second_monitor_commands() {
notify-send "Segundo monitor identificado!" "Configurações aplicadas automaticamente"
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 40
gsettings set org.gnome.desktop.interface text-scaling-factor 0.85
}