Skip to content

Instantly share code, notes, and snippets.

@rikardhassel
rikardhassel / gist:11183389
Created April 22, 2014 15:21
Wordpress Mobile Detection (Excluding iPad)
function my_wp_is_mobile() {
static $is_mobile;
if ( isset($is_mobile) )
return $is_mobile;
if ( empty($_SERVER['HTTP_USER_AGENT']) ) {
$is_mobile = false;
} elseif (
strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false
/**
* Private function connect()
* This function is the basic code for the call to mySQLi. Returns a link to server.
* @return object
*/
private function connect()
{
$link = new mysqli( $GLOBALS['db_host'], $GLOBALS['db_user'], $GLOBALS['db_pass'], $GLOBALS['db_db'] ) or die( mysqli_error( $link ) );
$link->set_charset( 'utf8' );
private $_link = null;
/**
* Private function connect()
* This function is the basic code for the call to mySQLi. Returns a link to server.
* @return object
*/
private function connect()
{
if ( $this->_link === null )
<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript" src="easyXDM.js"></script>
<script type="text/javascript">
var socket = new easyXDM.Socket({
onReady: function(){
socket.postMessage(document.body.scrollHeight)
}
});
</script>
/**
*
* Everyday hours shortcode handler.
* See https://github.com/MZAWeb/business-hours-plugin/wiki/Shortcodes
*
* @param $atts
*
* @return mixed|null
*/
public function shortcode_table( $atts ) {
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text 2 if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@rikardhassel
rikardhassel / compress.sh
Created October 18, 2013 10:08
Compresses the subdirectories of a specified directory.
#!/bin/bash
find . -maxdepth 1 -type d -not -path "." -exec tar -zcvf {}.tar.gz {} \;
return $(".pop-listfriend > div").removeClass("hide"), $(".pop-listfriend > div").addClass("hide"), $(".pop-listfriend > div.listAll").removeClass("hide"), !1
Problem 1
- suncat/mobile-detect-bundle dev-master requires mobiledetect/mobiledetectlib 2.7.* -> satisfiable by mobiledetect/mobiledetectlib[2.7.6, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5].
- suncat/mobile-detect-bundle dev-master requires mobiledetect/mobiledetectlib 2.7.* -> satisfiable by mobiledetect/mobiledetectlib[2.7.6, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.6].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.0].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.1].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.2].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.3].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.4].
- Can only install one of: mobiledetect/mobiledetectlib[dev-master, 2.7.5].