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
public class ReverseString { | |
public static void main(String[] args) { | |
String reversed = reverseString( "Reverse this string." ); | |
System.out.println( reversed ); | |
} | |
public static String reverseString( String newString ) { | |
// cleans up string if there are any extra spaces |
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
// replace background image when user clicks on a thumbnail | |
$projectImages.live( 'click', function(e) { | |
e.preventDefault(); | |
var $this = $( this ), | |
$bgImage = $( '.current-section .bg-image' ), | |
oldSrc = $bgImage.attr( 'src' ), | |
newSrc = $this.find( 'img' ).attr( 'src' ), | |
marginValue = $this.width() + 20, // 20 for the 10px margin-left and right | |
newThumbnail = '<li><a href="#"><img src="' + oldSrc + '" class="scale-with-grid"></a></li>', | |
newBgImage = '<img src="' + newSrc + '" alt="" class="bg-image">'; |
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 Page = { | |
getPageName: function() { | |
var pageName = document.URL.split( '/' ).pop(); | |
if( !pageName ) { | |
pageName = $( 'ul.menu li:first-child a' ).attr( 'href' ); | |
} | |
return pageName; |
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
//simply use Vimeo.init(); to find the videos and bind the events | |
var Vimeo = { | |
// we can add more events when we need to, e.g. onPause | |
events: { | |
// when videos are ready, we can attach our events | |
ready: function( player_id ) { | |
$f(player_id).addEvent( 'play', Vimeo.events.onPlay ); | |
}, | |
//when the play button is clicked |
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
<a href="#" class='notify'>Success!</a> | |
<a href="#" class='notify error'>Error :(</a> |
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
<div class="container"> | |
<div id="slider-container"> | |
<ul class="slider-images clearfix"> | |
<li><img class="scale" src="http://dummyimage.com/500x200/000/fff.gif&text=Slide+1" alt=""></li> | |
<li><img class="scale" src="http://dummyimage.com/500x200/fff/000.gif&text=Slide+2" alt=""></li> | |
<li><img class="scale" src="http://dummyimage.com/500x200/000/fff.gif&text=Slide+3" alt=""></li> | |
<li><img class="scale" src="http://dummyimage.com/500x200/fff/000.gif&text=Slide+4" alt=""></li> | |
</ul> | |
</div> |
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 | |
include('db.class.php'); | |
$database = new Database(); | |
$database->dbUrl = 'localhost'; //URL of database | |
$database->dbUser = 'root'; // Username | |
$database->dbPass = ''; // Password | |
$database->dbName = 'test_db'; // Name of database you wish to connect to |
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
// Any iframes with a class of .yt will be collected for event tracking | |
var Youtube = { | |
$players: $( '.yt' ), | |
playerArray: [], | |
numPlayers: $( '.yt' ).length - 1, | |
init: function() { | |
Youtube.assignID(); | |
Youtube.bindEvents(); | |
}, |
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 el = document.getElementsByTagName('html')[0]; | |
el.className = el.className.replace('no-js', 'js'); |
OlderNewer