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 | |
$handle = fopen ("php://stdin", "r"); | |
$arr_temp = fgets($handle); | |
$arr = explode(" ",$arr_temp); | |
$arr = array_map('intval', $arr); | |
sort($arr, SORT_NUMERIC); | |
$first_a = $last_a = $arr; |
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 | |
$handle = fopen ("php://stdin","r"); | |
fscanf($handle,"%d",$n); | |
for ($i = 1; $i <= $n; $i++) { | |
print str_repeat(' ', $n-$i); | |
print str_repeat('#', $i); | |
print PHP_EOL; | |
} |
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 | |
$handle = fopen ("php://stdin","r"); | |
fscanf($handle,"%d",$n); | |
$arr_temp = fgets($handle); | |
$arr = explode(" ",$arr_temp); | |
$arr = array_map('intval', $arr); | |
$count = count($arr); |
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 | |
$handle = fopen('php://stdin', 'r'); | |
fscanf($handle, '%d', $n); | |
$a = []; | |
for ($i = 0; $i < $n; $i++) { | |
$temp = fgets($handle); | |
$a[] = explode(' ', $temp); | |
array_walk($a[$i], 'invtal'); |
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
#!/bin/bash | |
for user in $@; do | |
now=$(date +"%Y-%m-%d") | |
uid=$(id -u $user) | |
# Lock user account | |
passwd -l $user | |
tar -zcvf /home/dflima/$user.$uid.$now.tar.gz /home/$user | |
# Kill user session |
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
find /srv/dev_data/xavier/ -type f -user "d.lima" -mtime -6 -exec cp --parents --target-directory=/home/d.lima/xavier_files/ {} \; |
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
find . -name ".env" -exec sed -i s/dev/test/g {} \; |
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
# Put the code below on your .gitconfig file, under "alias" section. | |
# Usage: | |
# git rename old_branch_name new_branch_name | |
[alias] | |
rename="!f() { git branch "$2" origin/"$1" && git push origin --set-upstream "$2" && git push origin --delete "$1"; }; f" |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 1, | |
"caret_extra_top": 1, | |
"caret_extra_width": 1, | |
"caret_style": "blink", | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme", | |
"enable_tab_scrolling": false, | |
"fade_fold_buttons": false, |
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 | |
function fib(int $n) : int | |
{ | |
return $n <=1 ? $n : fib($n-1) + fib($n-2); | |
} |