Skip to content

Instantly share code, notes, and snippets.

View aakos's full-sized avatar
🐢

Akos Aladics aakos

🐢
  • Crowdfunder
  • Newquay, UK
View GitHub Profile
@aakos
aakos / detect_ajax
Created February 4, 2013 12:37
PHP ajax detection snippet
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!';
@aakos
aakos / inline-block-whitespace-off
Created November 25, 2012 20:30
negate white space on inline-block elements
/*
* 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;
}