Skip to content

Instantly share code, notes, and snippets.

@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 / _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 / 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 / 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 / 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 / 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 / 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 / clear-linx-cached-ram.txt
Created September 12, 2012 10:35
Clear Linux Cached Ram
sync; echo 3 > /proc/sys/vm/drop_caches
@Coopeh
Coopeh / iptables-chain-numbers.txt
Created September 14, 2012 00:12
IPTables Chain Numbers
iptables -vnL --line-numbers
@Coopeh
Coopeh / iptables-chain-numbers-delete.txt
Created September 14, 2012 00:15
IPTables Chain Numbers Delete
iptables -D INPUT 22