This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.each($('#navigation ul li a'), function(event){ | |
var mylink = $(this).attr("href"); | |
var url = window.location; | |
//If there is a match, apply a class of current, otherwise, remove the class of current | |
if(url == mylink){ | |
$(this).addClass('current'); | |
}else{ | |
$(this).removeClass('current'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav id="navigation"> | |
<ul> | |
<li><a href="javascript:void(0);">Home</a></li> | |
<li><a href="javascript:void(0);">About</a></li> | |
<li><a href="javascript:void(0);">Resume</a></li> | |
<li><a href="javascript:void(0);">Contact</a></li> | |
</ul> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Pass in recent post settings into $args array | |
$args = array('numberposts' => 5, 'order' => 'DESC', 'orderby' => 'post_date'); | |
//Grab latest 5 posts | |
$postslist = get_posts($args); | |
//Loop through all posts and output the title, date, link to post and excerpt | |
foreach ($postslist as $post) : setup_postdata($post); | |
?> | |
<div class="latest-post"> | |
<a class="latest-title" href="<?php the_permalink(); ?>"title="<?php the_title(); ?>" > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nav ul li:first-child{color: red;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nav ul li:last-child{color: blue;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#boxBtn > a').on('click', function() { | |
$('#myList').stop(true, true).next("ul").toggle(700); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end('Yay, my first node server. Node.js is uber awesome.'); | |
}).listen(9090, '127.0.0.1'); | |
console.log('Server running at http://127.0.0.1:9090/node/'); |
OlderNewer