Skip to content

Instantly share code, notes, and snippets.

View joelbowen's full-sized avatar

Joel Bowen joelbowen

View GitHub Profile
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
@joelbowen
joelbowen / flushfooter.html
Created March 26, 2013 21:02
Flush Footer, HTML & CSS
<style>
html, body {
height: 100%;
}
#wrap {
min-height: 100%;
}
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@joelbowen
joelbowen / Install Apache, PHP, MySQL
Last active April 23, 2024 08:27
Amazon EC2 Basic Linux Commands for New Servers
/*****************CONNECTING TO THE EC2************************/
// Open Terminal, cd into the directory where you have your .pem
// You may need to change the permissions of the .pem to 600
chmod 600 pemfile.pem
// SSH into your instance
ssh -i pemfile.pem ec2-user@<AssociatedIp OR PublicDNS>
@joelbowen
joelbowen / Javascript Driven Table of Contents
Created April 9, 2013 17:02
Dynamic Table of Contents (JavaScript)
Source: http://css-tricks.com/automatic-table-of-contents/
Author: Chris Coyier
@joelbowen
joelbowen / functions.php
Last active December 16, 2015 14:19
Enqueue Google Fonts Properly in Wordpress
//Google Fonts Include
function google_fonts_css() {
wp_register_style( 'google_fonts_ptserif', 'http://fonts.googleapis.com/css?family=PT+Serif+Caption:400,400italic' );
wp_enqueue_style( 'google_fonts_ptserif' );
}
//Activate Custom Style Sheets
add_action ('wp_print_styles', 'google_fonts_css', 10);
@joelbowen
joelbowen / responsive_youTube.html
Last active December 17, 2015 05:29
Responsive YouTube videos
<!-- Adapted from http://avexdesigns.com/responsive-youtube-embed/ -->
<style>
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
@joelbowen
joelbowen / Setting-Up-TS3-Commands.txt
Created May 28, 2013 03:29
Setting Up TeamSpeak3 on Linux
//Note, the following ports should be open:
TCP:
22 (SSH)
10011
30033
UDP:
9987
//Start by creating a user to manage the TeamSpeak application:
@joelbowen
joelbowen / SettingUpVirtualHosts.conf
Created June 4, 2013 19:28
Using Virtual Hosts on EC2
//Get to the conf.d directory on your EC2
cd /etc/httpd/conf.d
//If this is a fresh install, you'll likely need to create a vhost file
vi vhost.conf
//In insert mode (i), paste the following:
@joelbowen
joelbowen / AmazonRDS on MySQL Workbench
Created July 12, 2013 20:54
Connecting to an Amazon RDS with MySQLWorkbench
Source: http://bit.ly/RDSWorkbench
Last couple of week I was looking for an easier approch to manage the Databases created on Amazon RDS instances. I had to run through a tedious set of steps in carrying out routine stuff like introducing new updates, taking daily backups and moving it to an Amazon S3 bucket, etc… Before getting into touch with MySQL Workbench had to run through several intermediate hops (Connect to one of the EC2 instance via SSH and connect to the RDS instance from there, ;-( ) even to run a small query on the tables.
Let me eleborate the step I followed in setting up the connect with the DB created on a Amazon RDS instance.
Step 1: Launch MySQL Workbench
Launch MySQL Workbench and select New Server Instance found under Server Administration section form the Welcome screen as shown in Figure 1.