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 | |
| # using: mirror.sh http://examplepage.com | |
| wget --mirror --page-requisites --no-parent --quota=0 --no-verbose --restrict-file-names=windows $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
| #!/bin/bash | |
| for img in *.jpg; | |
| do | |
| echo "Prcoessing image $img ..." | |
| /usr/bin/convert -thumbnail 1750 "$img" "thumb.$img" | |
| done |
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 | |
| SourceDirectory="source/" | |
| DestinationDirectory="../destination/" | |
| cd $SourceDirectory | |
| for CurrentSourceDirectory in $(find * -maxdepth 0 -type d ); | |
| do | |
| FileName=$(basename $CurrentSourceDirectory); |
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
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| import pprint | |
| from bs4 import BeautifulSoup | |
| class Fete: | |
| urls = { | |
| 'styczen' : 'http://pl.wikipedia.org/wiki/Imieniny_-_stycze%C5%84', |
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
| <?php | |
| include 'seconds-to-hms.php'; | |
| class SecondsToHmsTest extends PHPUnit_Framework_TestCase | |
| { | |
| public function provider() | |
| { | |
| return [ | |
| [60, '', '0h1m0s'], |
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
| <?php | |
| /** | |
| * Get all links from html content using DomDocument Class. | |
| * | |
| * @param string $content Html content. | |
| * @param bool $show_errors Show warnings when loading not valid html document. | |
| * @return array | |
| */ | |
| function get_all_links($content, $show_errors = true) { |
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
| <?php | |
| // Turn off all error reporting | |
| error_reporting(0); | |
| // Configuration | |
| $user = 'your_login'; | |
| $password = 'you_password'; | |
| $host = 'imap.gmail.com'; |
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
| <?php | |
| function percent($part, $sum, $round = 0) { | |
| return round($part / $sum * 100, $round) . '%'; | |
| } | |
| function round_size($size, $round = 0) { | |
| $sizes = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); | |
| for ($i = 0; $size > 1024 && $i <= 8; $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
| <?php | |
| /** | |
| * Scan host for open ports. | |
| * | |
| * @param string $host Host to scan. | |
| * @param integer $timeout The connection timeout, in seconds. | |
| * @return array | |
| */ | |
| function simple_port_scanner($host, $timeout = 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
| <?php | |
| // yep, it's not hard to decode | |
| $root = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR; | |
| $source = $root.'source-files'.DIRECTORY_SEPARATOR; | |
| $target = $root.'target-files'.DIRECTORY_SEPARATOR; | |
| $directory = new RecursiveDirectoryIterator($source); | |
| $iterator = new RecursiveIteratorIterator($directory); |
OlderNewer