Skip to content

Instantly share code, notes, and snippets.

View fatihtoprak's full-sized avatar
🎯
Focusing

Fatih Toprak fatihtoprak

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
....
</html>
<head>
<title>Bu bir deneme sayfasıdır.</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<img src="http://www.fatihtoprak.com/logo-shared.png" class="img-responsive" alt="Responsive image">
<div class="container">
<div class="row">
<div class="col-md-12">Tam da ortası olmalı sayfanın.</div>
</div>
</div>
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@fatihtoprak
fatihtoprak / strpos.php
Created January 9, 2016 02:18 — forked from hassanjamal/strpos.php
PHP : strpos recursive function
<?php
$mystring = 'welcome !! we are learning now string function';
$findme = 'learning';
$pos = strpos($mystring, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'"."\n";
"jquerycdn": "<script src=\"//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js\">",
"awesome": "<link rel=\"stylesheet\" href=\"maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css\" />",
"lesscss": "<link rel=\"stylesheet/less\" type=\"text/css\" href=\"base.less\" />",
"bootstrapcss": "<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\" />",
"bootstrapjs": "<script src=\"//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\">",
"lessjs": "<script src=\"//cdnjs.cloudflare.com/ajax/libs/less.js/2.6.0/less.min.js\">",
@fatihtoprak
fatihtoprak / medium-transient-api_example.php
Last active August 29, 2016 23:17
medium-transient-api_exaple.php
<?php
$transName = 'sonon-yazi';
$cacheTime = 10; //Zaman aralığı
if(false === ($prepared = get_transient($transName) ) ){
global $wpdb;
$prepared = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE `post_status` = 'publish' AND `post_type` = 'post' AND LIMIT 10 );
set_transient($transName, $prepared, 60 * $cacheTime);
}
?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap test</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>