Skip to content

Instantly share code, notes, and snippets.

@6ui11em
6ui11em / ht_upload_filesize.txt
Created May 2, 2012 17:59
htaccess: Max upload filesize
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200
@6ui11em
6ui11em / ht_redirect.txt
Created May 2, 2012 17:53 — forked from crazy4groovy/ht_redirect.txt
htaccess: Redirection rules
RewriteEngine On
RewriteBase /
### Redirect www to non-www ###
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
### Redirect non-www to www ###
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
@6ui11em
6ui11em / gist:2252065
Created March 30, 2012 14:51
CSS: Bootstrap center nav-pills in a row
.nav-tabs > li, .nav-pills > li {
float:none;
display:inline-block;
*display:inline; /* ie7 fix */
zoom:1; /* hasLayout ie7 trigger */
}
.nav-tabs {
text-align:center;
}
@6ui11em
6ui11em / gist:2004290
Created March 9, 2012 00:17
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@6ui11em
6ui11em / php-curl-post.php
Created March 8, 2012 07:55 — forked from davidvanvickle/php-curl-post.php
PHP: Curl post and write to file
$ch = curl_init($post_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('data1'=>'val','data2'=>'val2')));
$data_str = curl_exec($ch);
curl_close($ch);
file_put_contents($path_to_xml_data,$data_str);
@6ui11em
6ui11em / gist:1994233
Created March 7, 2012 16:35 — forked from yvesvanbroekhoven/jquery-extlink.js
JQuery: Open external link in a new window
/*
* Open external link in a new window
*/
$('a:not([href^="'+ window.location.protocol + '//' + window.location.host + '"]):not([href^="#"]):not([href^="/"])')
.attr('target', '_blank');