Skip to content

Instantly share code, notes, and snippets.

View DamianSam's full-sized avatar

Damian Samolej DamianSam

  • HFC
  • Brooklyn, NY
View GitHub Profile
@gicolek
gicolek / blah.php
Created February 6, 2013 16:47
Handle ajax requests (omitting admin-ajax.php)
<?php
function _foo_handle_ajax_request_for_db_data() {
$path = parse_url (site_url());
if ( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) === $path['path'] . '/sth' ) {
status_header(200);
// do sth
exit ;
@danny-englander
danny-englander / jquery.responsive-classes.js
Created September 13, 2012 00:16
JQuery Responsive Classes
/*
* Inspired by:
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed