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
<script type="text/javascript" data-message="hello"> | |
var scripts = document.getElementsByTagName( 'script' ); | |
console.log(scripts[ scripts.length - 1 ].getAttribute('data-message')); | |
</script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/paperjs/paper.js@0.12.11/dist/paper-full.js"></script> | |
<script type="text/paperscript" canvas="myCanvas"> | |
var background = new Path.Rectangle(view.bounds); | |
background.fillColor = 'white'; | |
var think = new Path.Circle(new Point(115, 120), 55); | |
think.strokeColor = '#B42371'; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Get Address from Postcode</title> | |
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script> | |
var geocoder; | |
function codeAddress() { | |
geocoder = new google.maps.Geocoder(); |
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
$('.elements') | |
.hide() | |
.each(function(index, element){ | |
var sleepTime = Math.floor(Math.random() * 2000), | |
t = setTimeout(function(){ | |
$(element).fadeTo(1000,1); | |
}, sleepTime); | |
}); |
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 a').click(function(){ | |
target = $(this).attr('href'); | |
targetOffset = $(target).offset().top; | |
$('html,body').animate({ scrollTop: targetOffset }, 'slow'); | |
return false; | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>CSS Flip</title> | |
<style type='text/css'> | |
/* entire container, keeps perspective */ | |
.flip-container { | |
-webkit-perspective: 1000; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Parallax</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
var $scroll = ($.browser.mozilla || $.browser.msie) ? $('html') : $('body'), |
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
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
var latlng = new google.maps.LatLng(1.285121,103.852322), | |
map = new google.maps.Map(document.getElementById('googlemap'), { | |
zoom: 15, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}), | |
marker = new google.maps.Marker({ |
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
$(window).scroll(function(){ | |
toScroll = $(document).height() - $(window).height() - 250; | |
if ( $(this).scrollTop() > toScroll ) { | |
// Do something | |
} | |
}); |
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
rsync -arvuz --delete --include .htaccess --exclude .git --exclude .gitignore --exclude deploy ~/beta.example.com/ ~/example.com/ |