Skip to content

Instantly share code, notes, and snippets.

@alkrauss48
alkrauss48 / jquery.video.js
Last active September 14, 2015 15:56
Responsive Video Lightbox that will always view on 16:9 resolution at maximum screen height/width
function closeVideo(){
$('#dark-overlay').fadeOut(500);
$('#iframe-wrapper').fadeOut(500);
$('#iframe-wrapper').find('iframe').attr('src', '');
}
$(document).ready(function(){
$('a.close-video').click(function(e){ closeVideo(); });
$('a.play-now').click(function(e){
@alkrauss48
alkrauss48 / wordpress_plugins.md
Last active August 29, 2015 14:03
Base Set of Wordpress Plugins

The following is my base list of Wordpress plugins that I think a developer should always make use of for a new WP site:

@alkrauss48
alkrauss48 / jquery.text_highlight.js
Last active August 29, 2015 14:03
Highlighting Text Around Each Character
// This entire file is optional. May be useful if using with a CMS where your users are
// entering in paragraphs, and you always want to highlight their paragraph text by default
$('p').wrapInner('<span class="highlight"></span>');
@alkrauss48
alkrauss48 / accessibility_skipmenu.html
Last active August 29, 2015 14:03
Accessibility Jump Menu for Keyboard Users- Use this for every site if you want max accessibility
<body>
<div id="skipmenu">
<a href="#menuArea" class="skippy">Skip directly to menu</a>
<a href="#contentArea" class="skippy">Skip directly to site content</a>
<a href="#footerArea" class="skippy">Skip directly to site footer</a>
</div>
.
.
.
<!-- Use a link like the following to skip to this point -->

How domain names turn into valid IPs

It's more than you probably think

  1. A user types the URL http://www.example.com into a browser.

  2. The browser sends a request for the IP address of www.example.com to its local resolver (stub-resolver).

  3. The stub-resolver queries the locally configured DNS Resolver for the IP address of www.example.com.

@alkrauss48
alkrauss48 / index.html
Last active August 29, 2015 14:04
D3 Chart Practice
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="train_colours.css" title="" type="text/css" />
<style type="text/css" media="all">
.axis path, .line{
stroke:black; }
.line { float:left;
} .line_container{
@alkrauss48
alkrauss48 / mysql_commands.sql
Last active October 27, 2016 20:34
MySQL CLI Commands for New DB & User
# Create the database
create database test_database;
# Create a user with a password
create user 'username'@localhost identified by 'password';
# Give the new user full privileges on the new database
grant all privileges on test_database.* to 'username'@localhost;
# Refresh everyone's privileges
@alkrauss48
alkrauss48 / x-nav.html
Last active August 29, 2015 14:05
Responsive Nav - 3 Lines Turn Into an X when Clicked
<!-- An example of this exact code can be found live at http://thesocietea.org/ - just shrink the screen down -->
<nav class="nav">
<ul>
<li>
<a id="responsive-menu-icon">
<span class="line-one"></span>
<span class="line-two"></span>
<span class="line-three"></span>
</a>
@alkrauss48
alkrauss48 / request_forwarder.php
Created August 21, 2014 20:05
Server Side Request Forwarder - accepts client side post requests and submits them to the real destination server side
<?php
// Assuming a POST to this script in form of:
// request_forwarder?url=url_name
//
// This will convert a client side AJAX request to a server side PHP curl,
// thus eleminating worries of cross-site scripting and having to abide by
// cross-origin-request-sharing (CORS) settings on the end server.
$url = $_GET['url'];
$fields_string = '';
@alkrauss48
alkrauss48 / is_mobile.js
Created September 4, 2014 22:28
JS Object to test if userAgent is mobile - and if so, what device
// From http://stackoverflow.com/questions/11381673/javascript-solution-to-detect-mobile-browser#answer-13819253
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {