Skip to content

Instantly share code, notes, and snippets.

var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i) ? true : false;
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i) ? true : false;
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
},
@kanedo
kanedo / file_extension.sh
Created July 18, 2012 14:16
Fileextension finder
#!/bin/bash
# For each file with the given extension in the current directory...
echo "Pfad;Datei;Groesse (in Byte)";
if [[ "x$1" == "x" ]]
then
echo "no path given - exiting" >&2
exit 1;
fi
find $1 -not -path */dev/* -type f -execdir bash -c 'echo -en "$PWD;$(basename {});$(stat -f %z {})\n"' \;
@kanedo
kanedo / run.sh
Created July 11, 2012 11:03
Gitlab Thin Deamontools Skript
#!/bin/bash
# This is needed to find gems installed with --user-install
export USER=kanedo
export HOME=/home/kanedo
# Include our profile to get Ruby 1.9.2 included in our PATH (via rvm)
. $HOME/.bash_profile
export PORT=<Port>
@kanedo
kanedo / gist:2127999
Created March 19, 2012 23:01
GoogleAnalytics Plugin vs. Readability Favorites
//googleanalytics.php Line 824:
function authenticate() {
if ( isset( $_REQUEST['oauth_token'])) {
//…
//should be something like this
function authenticate() {
if ( isset( $_REQUEST['oauth_token']) && $_REQUEST['page'] == 'google-analytics-for-wordpress' ) {
@kanedo
kanedo / wpTimeMachineCore.php1
Created January 24, 2012 13:07
WP-Timemachine fix
function wpTimeMachine_enqueue_scripts()
{
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
wp_deregister_script( 'jquery-ui-core' );
wp_register_script( 'jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js' );
wp_enqueue_script( 'jquery-ui-core' );
wp-content/plugins/wp-time-machine/includes/wpTimeMachineCore.php anschauen. Dort findet sich auf Zeile 865 folgende Funktion: function wpTimeMachine_enqueue_scripts()
{
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
wp_deregister_script( 'jquery-ui-core' );
wp_register_script( 'jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js' );
wp_enqueue_script( 'jquery-ui-core' );