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 | |
use Carbon\Carbon; | |
$date = new Carbon('first day of january 2008'); | |
// aqui tu só trocas o ano final que tu queres validar | |
$end_date = new Carbon('last day of december 2025'); | |
while ($date < $end_date) { | |
if ($date->isSaturday()) { |
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/sh | |
inotifywait --recursive --monitor --quiet --event close_write --format '%f' /home/pi/Videos/ | | |
while read FILE ; do | |
reboot | |
done |
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 | |
RSYNC=/usr/bin/rsync | |
SSH=/usr/bin/ssh | |
KEY=/home/pi/.ssh/remoteuser_rsa.pem | |
RUSER=remoteuser | |
RHOST=remotehost.com.br | |
RPATH=/home/remoteuser/videos/* | |
LPATH=/home/pi/Videos/ |
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 | |
RSYNC=/usr/bin/rsync | |
SSH=/usr/bin/ssh | |
KEY=/home/pi/.ssh/remoteuser_rsa.pem | |
RUSER=remoteuser | |
RHOST=remotehost.com.br | |
RPATH=/home/remoteuser/videos/* | |
LPATH=/home/pi/Videos/ |
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 it to your .bashrc. | |
# Usage: create_post "My post name" | |
# or: create_post | |
# The script will generate the slug, ask for author's, ask | |
# if you want to generate permalink and tags | |
function create_post { | |
title=$1 | |
# if no post title was supplied |
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
['De vermelho', 'De preto', 'De verde', 'De amarelo', 'De rosa', 'De turquesa', 'De azul', 'De roxo', 'De lilás', 'De azul marinho', 'De cor de burro quando foge', 'De rosa bebê', 'De azul maravilha', 'De off-white'], | |
['Flamejante', 'Escaldante', 'Militante', 'Fumegante', 'Chamejante', 'Colorante', 'Exuberante', 'Deslumbrante', 'Estafante', 'Enfartante', 'Coadjuvante', 'Aconchegante', 'Gotejante', 'Rastejante'], | |
['Labaredas de fogo', 'Calabresas de molho', 'Milanesas ao forno', 'Cabeleiras de molho', 'Carambolas em jogo', 'Sabonete Sococo', 'Vai Botafogo', 'Eu to de fogo', 'Rodas de pogo', 'Vermelho agogô', 'Sdds do Togo', 'Ta ardendo o flogo', 'Recalcadas adogo ', 'Vestida de Gorpo'], | |
['Olhos brilhantes', 'Boca irritante', 'Feios mirantes', 'Testa de diamante', 'Suvacos de desodorante', 'Ombreiras exubeirantes', 'Fraldas e estimulantes', 'Umbigo retumbante', 'Orelhas de elefante', 'Costas escaldantes', 'Pés verossimilhantes', 'Perucas e corantes', 'Ganhos escoriantes'], | |
['Que sorriem', 'Que riem', 'Carpe die |
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
%% This module is in file tut5.erl | |
-module(tut5). | |
-export([format_temps/1]). | |
%% Only this function is exported | |
format_temps([])-> % No output for an empty list | |
ok; | |
format_temps([City | Rest]) -> | |
print_temp(convert_to_celsius(City)), | |
format_temps(Rest). |
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
# empacotar com tar | |
tar -cvf [nome_do_arquivo].tar [arquivos_ou_pasta] | |
# empacotar e compactar | |
# # gzip | |
tar -cvzf [nome_do_arquivo].tar.gz [arquivos_ou_pasta] | |
# # bzip2 |
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 | |
pwd=$(pwd) | |
cd app/imgs | |
for file in $(ls ./); do | |
name=(${file//_/ }) | |
new_dir=${name[0]} |
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 | |
pwd=$(pwd) | |
cd app/imgs | |
for file in $(ls ./); do | |
name=(${file//_/ }) | |
mv $file ${name[1]}"_"${name[2]} | |
done |