This file contains 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/expect -f | |
# Requires: expect, spawn | |
spawn ssh-add | |
expect "Enter passphrase for /home/zaphod/.ssh/id_rsa:" | |
send "my_password" | |
interact |
This file contains 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
<?php | |
/** | |
* Given a collection that implements the Iterator interface: | |
* @see https://www.php.net/manual/en/class.iterator | |
*/ | |
return (int)!empty($collection->entries) * ($collection->key() + 1); |
This file contains 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
<?php | |
declare(strict_types = 1); | |
/** | |
* factorialFactorial | |
* Finding the factorial of a $number by recursion | |
* | |
* @author Er Galvão Abbott <galvao@php.net> | |
*/ |
This file contains 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
sudo dnf -y update && sudo dnf -y install xclip && xclip -selection clipboard < ~/.ssh/NOME_DA_CHAVE.pub |
This file contains 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/bash | |
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc | |
cat <<EOF | sudo tee /etc/yum.repos.d/vscode.repo | |
[code] | |
name=Visual Studio Code | |
baseurl=https://packages.microsoft.com/yumrepos/vscode | |
enabled=1 | |
gpgcheck=1 |
This file contains 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
sudo dnf -y install httpd mariadb mariadb-server php-cli php-intl php-mbstring php-pdo php-sodium php-xml php-gd php-mysqlnd php-devel php-ffi php-fpm php-pear php-mbstring php-bcmath |
This file contains 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
C:\laragon\bin\php\php-7.2.19-Win32-VC15-x64\php C:\composer\composer.phar create-project --prefer-dist laravel/laravel C:\laragon\www\laravel54_example "5.4.*" |
This file contains 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
# Add the -c flag and set the core.fileMode option to false, e.g.: | |
git -c core.fileMode=false status |
This file contains 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
<?php | |
$now = new DateTime(); | |
$freeze = new DateTimeImmutable(); | |
$now->setTimeZone(new DateTimeZone('UTC')); | |
$freeze->setTimeZone(new DateTimeZone('UTC')); | |
echo $now->format('Y-m-d H:i:s P'); | |
// 2020-12-11 12:50:48 +00:00 | |
$freeze->format('Y-m-d H:i:s P'); | |
// 2020-12-11 09:50:51 -03:00 |
This file contains 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
console.clear(); | |
function oddOrEven(n) | |
{ | |
return new Promise((resolve, reject) => { | |
if (typeof(n) != 'number') { | |
reject(new TypeError('n must be a number')); | |
} | |
if ((n % 2) == 0) { |
NewerOlder