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. | ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 ## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++ { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#ifndef _WIN32 | |
#include <unistd.h> | |
#else | |
#include <windows.h> | |
void usleep(__int64 usec) | |
{ | |
HANDLE timer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
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
- NVIDIA graphics card driver (v450.57)
- CUDA (v11.0.2)
- cuDNN (v8.0.2.39)
on an Ubuntu Linux system, in particular Ubuntu 20.04.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
NewerOlder