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 | |
/** | |
* | |
* This is a quick way to turn a simple text file | |
* with a list of urls in a text file (sitemap-urls.txt) | |
* into a valid XML Sitemap: | |
* http://en.wikipedia.org/wiki/Sitemaps | |
* Put this file sitemap.xml.php and sitemap-urls.txt at | |
* the webroot http://example.com/sitemap.xml.php |
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
from gpiozero import LED | |
import time | |
import keyboard | |
K = input("Sleep for: ") | |
zeleno = LED(18) | |
zuto = LED(17) | |
crveno = LED(23) | |
crveno_indikator = LED(21) | |
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
safemode=on |
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 Security Headers | |
<IfModule mod_headers.c> | |
# Protect against XSS attacks | |
Header set X-XSS-Protection "1; mode=block" | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] | |
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | |
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) |
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 | |
#--------kompresuj_stranicu---------# | |
function KompresujStranu($Baferuj) { | |
$Pretrazi = array( | |
'/\>[^\S ]+/s', // ocisti razmake izmedju tagova, izuzev spejsa | |
'/[^\S ]+\</s', // ocisti razmake pre tagova, izuzev spejsa | |
'/(\s)+/s' // skrati vise spojenih spejsova | |
); | |
$Zameni = array( | |
'>', |
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 | |
/* counter */ | |
//opens countlog.txt to read the number of hits | |
$datei = fopen("./countlog.txt","r"); | |
$count = fgets($datei,1000); | |
fclose($datei); | |
$count=$count + 1 ; | |
echo "<p>$count" ; |
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 | |
//skupi stranice u niz, kompresuj, keshiraj i baferuj :) | |
$css = array("master.css", "acc.css", "anm.css", "qrs.css"); | |
$bffr = ""; | |
foreach ($css as $cs) { | |
$bffr .= file_get_contents($cs); | |
} | |
$bffr = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $bffr); | |
$bffr = str_replace(': ', ':', $bffr); | |
$bffr = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $bffr); |
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 rostilj_calculator($broj_osoba = 1 , $difficulty_level = 1){ | |
//po osobi | |
$materijal = array( | |
'meso'=> array( | |
'po osobi'=>true, | |
'kolicine'=> array( | |
'cevapi' => 3.2, | |
'vrat' => 1.2, |
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 | |
$cinit = curl_init(); curl_setopt($cinit, CURLOPT_URL,"http://antistereotip.net/"); | |
#-- timeout posle 30 sekundi --# | |
curl_setopt($cinit, CURLOPT_TIMEOUT, 30); curl_setopt($cinit, CURLOPT_RETURNTRANSFER,1); | |
$result=curl_exec ($cinit); curl_close ($cinit); | |
#-- Pretrazuje rezultate iz url-a --# | |
if($result) { | |
#-- TODO: Regularni izrazi, ali odraditi ovo samo za top domene :) --# | |
$regex = "/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i"; | |
$regex2 = '/\b(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)[-A-Z0-9+&@#\/%=~_|$?!:,.]*[A-Z0-9+&@#\/%=~_|$]/i'; |
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 | |
include_once('simple_html_dom.php'); | |
$target_url = 'http://example.net'; | |
$html = new simple_html_dom(); | |
$html->load_file($target_url); | |
foreach($html->find('a') as $link) | |
{ | |
echo $link->href."<br />"; | |
} |
NewerOlder