Skip to content

Instantly share code, notes, and snippets.

View asilbalaban's full-sized avatar

Asil Balaban asilbalaban

View GitHub Profile
@asilbalaban
asilbalaban / responsive-size.css
Created March 14, 2014 11:31
Responsive window size standarts
@media screen and (max-width:320px) {}
@media screen and (min-width:321px) and (max-width:639px) {}
@media screen and (min-width:640px) and (max-width:959px) {}
@media screen and (min-width:960px) and (max-width:1279px) {}
@media screen and (min-width:1280px) and (max-width:1599px) {}
@media screen and (min-width:1600px) {}
@media screen and (min-width:1920px) {}
@media print {}
@asilbalaban
asilbalaban / a.php
Created March 16, 2014 15:03
PHP ile dosya yüklemeden önce dosya adındaki problem yaratabilecek tüm kararkterleri temizlemek için bir fonksiyon
function clean( $str ) {
return preg_replace("/[^a-z0-9\.]/", "", strtolower($str));
}
if( $_SERVER['SERVER_ADDR'] == '127.0.0.1' ) {
define('ENVIRONMENT', 'development');
} else {
define('ENVIRONMENT', 'production');
}
@asilbalaban
asilbalaban / .htaccess
Created March 18, 2014 09:19
.htaccess for deflate
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
@asilbalaban
asilbalaban / .htaccess
Created March 18, 2014 09:21
.htaccess for removing index.php on codeigntier
RewriteEngine on
RewriteCond $1 !^(index\\.php|resources|robots\\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
@asilbalaban
asilbalaban / replace.sql
Created April 17, 2014 18:42
sql find and replace
UPDATE table SET row = REPLACE(row, 'old value', 'new value');
@asilbalaban
asilbalaban / img.css
Created May 4, 2014 13:46
wordpress img css
img.size-auto,
img.size-full,
img.size-large,
img.size-medium,
.attachment img {
max-width: 100%; /* When images are too wide for containing element, force them to fit. */
height: auto; /* Override height to match resized width for correct aspect ratio. */
}
.alignleft,
img.alignleft {
@asilbalaban
asilbalaban / mail.md
Created May 27, 2014 05:38
Mail kurulum bilgileri maili

GELEN SUNUCUSU YAPILANDIRMA

Protokol

POP3

Gelen Sunucusu

mail.domainadresi.com

Port

110

@asilbalaban
asilbalaban / date-diff.php
Created May 30, 2014 13:39
Finding the number of days between two dates
<?php
$now = time(); // or your date as well
$your_date = strtotime("2010-01-01");
$datediff = $now - $your_date;
echo floor($datediff/(60*60*24));
?>
@asilbalaban
asilbalaban / a.css
Created June 4, 2014 11:16
css ul li divider
li + li:before{
content: " | ";
padding: 0 10px;
color: darken(@eflatun, 40%);
}