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
<VirtualHost *:80> | |
ServerName zaa.dev | |
## Vhost docroot | |
DocumentRoot "/var/www/zaa/public" | |
## Directories, there should at least be a declaration for /var/www/veteriner/ | |
public |
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 | |
/* | |
* (c) Mark Badolato <[email protected]> | |
* | |
* This content is released under the {@link http://www.opensource.org/licenses/MIT MIT License.} | |
*/ | |
namespace Bado\ScoreCalculator; |
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
was just looking into how to solve this same problem, but I also want my function to create a token that can be used for password retrieval as well. This means that I need to limit the ability of the token to be guessed. Because uniqid is based on the time, and according to php.net "the return value is little different from microtime()", uniqid does not meet the criteria. PHP recommends using openssl_random_pseudo_bytes() instead to generate cryptographically secure tokens. | |
A quick, short and to the point answer is: | |
bin2hex(openssl_random_pseudo_bytes($bits)) | |
which will generate a random string of alphanumeric characters of length = $bits * 2. Unfortunately this only has an alphabet of [a-f][0-9], but it works. | |
Below is the strongest function I could make that satisfies the criteria (This is an implemented version of Erik's answer). | |
function crypto_rand_secure($min, $max) { | |
$range = $max - $min; |
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 | |
$metin = "{{<strong>selami</strong><br/>}}askldjakldjadkljas{{şahin}}"; //İlk Deneme | |
$metin = '{{</w:t></w:r><w:proofErr w:type="gramStart"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>Sinif.isim</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>}}'; //Orj | |
$metin = '{{isim}} {{</w:t></w:r><w:proofErr w:type="gramStart"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>Sinif.isim</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r w:rsidR="00B01C59" w:rsidRPr="00B01C59"><w:t>}}'; //Son | |
echo $metin; | |
$metin = preg_replace('/<[^>]*>/', '', $metin); //Regex ile diret stip tags | |
preg_match_all("/\{\{(.*)\}\}/USi", $metin, $array); | |
print_r($array); |
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
add_filter("the_title","mapStringConvert"); | |
function mapStringConvert($url){ | |
$s = array("×","&","×"); | |
$d = array("x","&","X"); | |
return str_replace($s,$d,$url); | |
} |
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
function mapStringConvert($url){ | |
$s = array("×","&"); | |
$d = array("x","&"); | |
return str_replace($s,$d,$url); | |
} |
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
$dm = $this->get('doctrine_mongodb')->getManager(); | |
$product = $dm->getRepository('AcmeStoreBundle:Zips')->find('526b80de20de4cbaa60c9946'); | |
print_r($product); |
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
<body> | |
<div> | |
<ul class='bir'> | |
<li> | |
<a href='' class='deneme'>Test</a> | |
</li> | |
<li class='aktif'> | |
<a href='' class='aikin'>Test</a> | |
</li> | |
</ul> |
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
$arrays[] = $column1; | |
$arrays[] = $column2; | |
$arrays[] = $column3; | |
$arrays[] = $column4; | |
$return = array(); | |
for($x=0;$x<3;$x++){ | |
for($y=0;$y<4;$y++){ |
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
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
server_name .siteadi.com; | |
if ($host == 'www.siteadi.com' ) { | |
rewrite ^/(.*)$ http://siteadi.com/$1 permanent; | |
} | |
root /var/www/siteadi.com; |
NewerOlder