Skip to content

Instantly share code, notes, and snippets.

Avatar

Akos Aladics aakos

  • Crowdfunder
  • Newquay, UK
View GitHub Profile
@aakos
aakos / inline-block-whitespace-off
Created Nov 25, 2012
negate white space on inline-block elements
View inline-block-whitespace-off
/*
* Taken from: http://yui.yahooapis.com/3.5.0/build/cssgrids/grids.css
*/
.nav {
letter-spacing: -0.25em; /*webkit*/
*letter-spacing: normal; /*IE hack*/
word-spacing: -0.43em;
}
@aakos
aakos / detect_ajax
Created Feb 4, 2013
PHP ajax detection snippet
View detect_ajax
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
{
// If it's ajax do your stuff
echo 'This is coming via ajax!';
exit;
}
//if not an ajax do other stuff
echo 'This is coming from PHP!';