Skip to content

Instantly share code, notes, and snippets.

@Coopeh
Coopeh / google-chrome-no-disk-cache-osx.txt
Created September 11, 2012 00:46
Google Chrome No Disk Cache OS X
Open your favourite terminal
cd /Applications/Google\ Chrome.app/Contents/MacOS/
cp Google\ Chrome chrome
cat /dev/null > Google\ Chrome
nano Google\ Chrome
Paste the next step:
#!/bin/sh
exec /Applications/Google\ Chrome.app/Contents/MacOS/chrome –disk-cache-dir=”/dev/null/” $@
ctrl + x
y
@Coopeh
Coopeh / google-analytics-custom-tracking.php
Created August 23, 2012 13:16
PrimaryBlogger Google Analytics Custom Tracking
<?php if (is_user_logged_in() ) { ?>
_gaq.push(['_setCustomVar', 1, 'logged_in', 'true', 1]);
_gaq.push(['_setCustomVar', 2, 'user-name', '<?php global $current_user; get_currentuserinfo(); echo $current_user->user_login ; ?>', 1]);
_gaq.push(['_setCustomVar', 3, 'blog-address', '<?php $str = get_bloginfo('url');$str = preg_replace('#^https?://#', '', $str);echo $str; ?>', 1]);
<?php } else { ?>
_gaq.push(['_setCustomVar', 1, 'logged_in', 'false', 1]);
_gaq.push(['_setCustomVar', 3, 'blog-address', '<?php $str = get_bloginfo('url');$str = preg_replace('#^https?://#', '', $str);echo $str; ?>', 1]);
<?php } ?>
@Coopeh
Coopeh / webkit-css3-rotation-transform-fix.css
Created August 23, 2012 13:01
Webkit CSS3 Rotation Transform Fix
figure#user_logo div.logo:hover{
-webkit-transform:rotate(30deg);
-moz-transform:rotate(30deg);
-o-transform:rotate(30deg);
/* Webkit Rotation Flicker Fix */
-webkit-transform-style: preserve-3d;
}
@Coopeh
Coopeh / comment-form-url-hide.css
Created June 20, 2012 20:35
Hide Comment Form URL Field
#commentform #url, #commentform #url +label, .comment-form-url {
display:none;
}
@Coopeh
Coopeh / comment-honeypot.php
Created June 20, 2012 20:29
WordPress Spam Comment HoneyPot
<?php
/*
Plugin Name: Comment HoneyPot
Description: Disallows any comments from users who add a url to the invisible webpage form field
Author: Tim Whitlock - Mods by Ed Cooper
Author URI: http://timwhitlock.info/
Version: 0.1
*/
function _tw_intercept_comment( array $data ){
@Coopeh
Coopeh / _tw_intercept_comment.php
Created June 20, 2012 09:28 — forked from timwhitlock/_tw_intercept_comment.php
Boot any comment bot that fills in the author website field
<?php
/**
* Boot any comment bot that fills in the author website field.
*/
function _tw_intercept_comment( array $data ){
if( empty($data['comment_author_url']) ){
return $data;
}
get_header();
echo 'See ya';
@Coopeh
Coopeh / gist:2947868
Created June 18, 2012 10:56
Responsive Online Video CSS
.video {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video iframe, .video object, .video embed {
position: absolute;
@Coopeh
Coopeh / gist:2947862
Created June 18, 2012 10:55
Responsive Online Video
<div class="video">
<iframe src="blablabla"></iframe>
</div>
@Coopeh
Coopeh / gist:2947860
Created June 18, 2012 10:54
Stop Skype Restyling Phone Numbers
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"/>
@Coopeh
Coopeh / disable-autosave.php
Last active October 6, 2015 05:58
Disable Autosave
function disabler_kill_autosave(){
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disabler_kill_autosave' );