Skip to content

Instantly share code, notes, and snippets.

View asilbalaban's full-sized avatar

Asil Balaban asilbalaban

View GitHub Profile
@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 / domain.php
Created March 19, 2014 07:52
Codeigniter get domain name. Put this function to your url_helper
function getDomain()
{
$CI =& get_instance();
return preg_replace("/^[\w]{2,6}:\/\/([\w\d\.\-]+).*$/","$1", $CI->config->slash_item('base_url'));
}
@asilbalaban
asilbalaban / .htaccess
Created March 21, 2014 09:41
Remove index.php on slim framework
RewriteEngine On
RewriteBase /path/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
@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 / dummy.html
Created May 4, 2014 13:45
Wordpress Theme Dummy HTML Markup
<h1>This is the H1 Heading</h1>
<p>Above this paragraph should be the H1 heading for your web page. If it is not visible, the design settings for the H1 tag is set to <code>display:none</code> which many WordPress Themes use to hide the blog title text and replace it with a graphic. Do not use H1 within your blog post area.</p>
<p>If the design in the H1 heading looks like your blog title or blog post title, then that is the style set for that HTML tag and you should not use it within your blog post area.</p>
<p>Inside of this test data section are most of the basic HTML and XHTML and CSS styles that you might use within your WordPress Theme. You need to know what that will look like as part of structuring your styles.</p>
<h2>This is the H2 Heading</h2>
<p>Above this paragraph should be the H2 heading for your web page. WordPress Themes use the h2 heading for various purposes. Logically, it should be either the post title or the first heading in the post content.</p>
<p>However, it is used all over WordPres
@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