Skip to content

Instantly share code, notes, and snippets.

View al-the-x's full-sized avatar

David Rogers AKA "AL the X" al-the-x

View GitHub Profile
$(function() { // on document ready
$('#tabs li').on('click', function(event) {
// Every <a> on the page?
// $('a').parent().removeClass('tab-current');
$(this).siblings().removeClass('tab-current');
$(this).addClass('tab-current');
// Every <section> on the page?
// $('section').removeClass('content-current');
body {
font-family: Arial, sans-serif;
color: cornflowerblue;
}
.tabs {
position: relative;
width: 100%;
margin-top: 1em;
/*missing / broken images
body text: cornflower blue
non-default font: ???
tabs!
decorative icons next to each tab
laid out side-by-side (horizontally)
bottom border under all tabs except active
spacing between tabs: ???px / ???pt
active tabs:
top border is heavier
@al-the-x
al-the-x / app.js
Last active August 29, 2015 14:21
(function (window) { // IIFE: Immediately Invoked Function Expression
'use strict'; // For bonus points, what does this do?
// CONTROLLER FOR: I can add a task to my list...
// 1. What event should I be listening for? keydn, keyup, keypress
// 2. What element makes sense to listen for that event? input.new-todo
// 3. What do I need to do when that event fires?
// GIVEN an HTML element <input class="new-todo">
var newTodoInput = document.querySelector('input.new-todo');
(function (window) { // IIFE: Immediately Invoked Function Expression
'use strict'; // For bonus points, what does this do?
var list = [ ];
console.log(list);
todos.addTaskToList("Remember the milk", list);
console.log(list);
@al-the-x
al-the-x / irb.rb
Created May 14, 2015 00:43
Ruby on Rails crash course for @TheIronYard--Orlando courtesy of @bgates
$> todos = "Learn Ruby"
=> "Learn Ruby"
$> todos << " on Rails"
=> "Learn Ruby on Rails"
$> todos << ", go home happy"
=> "Learn Ruby on Rails, go home happy"
$> todos.split
=> ["Learn", "Ruby", "on", "Rails", "go", "home", "happy"]
$> todos.split ','
=> ["Learn Ruby on Rails", " go home happy"]
// Just a tracer...
// alert("It's alive!");
debugger;
document.head.parentElement.className="js"; // It's alive!
var elements = document.querySelectorAll('.cbp-nttrigger');
// var nestedElements = document.querySelectorAll('h4');
// elements[0].addEventListener('click', function(){
// elements[0].parentElement.classList.toggle('cbp-ntopen');
@al-the-x
al-the-x / example.js
Created May 6, 2015 04:37
Look, ma, it's a function...
// function definition
function addition(a, b /* paramters go here */){
// function body
return a + b;
}
// function invocation
addition(3, 5 /* arguments go here */); // yields 8
addition(2, 7); // yields 9
@al-the-x
al-the-x / how-pretty.html
Created April 24, 2015 02:09
Where those spaces come from when using `inline-block`...
<style>
nav > a { display: inline-block; }
</style>
<nav>
<a href="#">A giant tile link</a>
<a href="#">Another tile link</a>
</nav>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> TIY Catalog -- TheIronYard does Etsy right </title>
<meta name="description" content="">