Skip to content

Instantly share code, notes, and snippets.

define('WP_HOME','http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL','http://' . $_SERVER['SERVER_NAME']);
@Boztown
Boztown / gist:4f7bf5b99b15380f0498
Created April 28, 2015 21:18
Install Rbenv on Ubuntu
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
@Boztown
Boztown / gist:10c9f77cee456510646f
Created April 6, 2015 03:56
Code to back up Wordpress database
// http://www.codesynthesis.co.uk/code-snippets/code-to-backup-a-wordpress-database
<?php
global $wpdb;
// Get a list of the tables
$tables = $wpdb->get_results('SHOW TABLES');
$upload_dir = wp_upload_dir();
define('WP_HOME','http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL','http://' . $_SERVER['SERVER_NAME']);
@Boztown
Boztown / gist:f4868ae22277dc86d4de
Last active August 29, 2015 14:11
CSS3 (Webkit) Pulsating Arrow (Fade in/out)
<div class="arrow-down">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/pulse-arrow.png" />
</div>
<style type="text/css">
.arrow-down {
position: absolute;
bottom: 50px;
width: 30px;
left: 50%;
@Boztown
Boztown / gist:228dc84d9f875f6c54a5
Created December 4, 2014 23:02
WP-CLI Search-Replace
wp search-replace http://yoursite.dev http://yoursite.com
@Boztown
Boztown / genesis-entry-footer.php
Last active August 29, 2015 14:10
Genesis Entry Footer
<?php
// don't include opening php
function your_theme_genesis_post_meta($post_meta) {
$post_meta = '<a href="" class="button">Leave me a comment!</a> [post_comments]';
return $post_meta;
}
add_filter( 'genesis_post_meta', 'your_theme_genesis_post_meta' );
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Neota Tech | Home</title>
<link rel="icon" type="image/png" href="/assets/images/favicon.png">
<link rel="stylesheet" type="text/css" href="//cloud.typography.com/7834852/678784/css/fonts.css" />
<link rel="stylesheet" href="css/screen.css" media="screen">
</head>
@Boztown
Boztown / gist:9082640
Last active August 29, 2015 13:56
jQuery "on" with preventDefault in CoffeeScript
jQuery ->
$('#login-button').on 'click', (e) =>
e.preventDefault()
alert( 'hey' )
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]
</IfModule>