Skip to content

Instantly share code, notes, and snippets.

View webapprentice's full-sized avatar

Web Apprentice webapprentice

View GitHub Profile
@webapprentice
webapprentice / tutorial_4_example_1.html
Created November 7, 2013 18:31
Embed a YouTube video in your web page
<iframe width="420" height="315" src="//www.youtube.com/embed/vzeBDcmrjjY" frameborder="0" allowfullscreen></iframe>
@webapprentice
webapprentice / tutorial_5_example_1.html
Created November 7, 2013 18:33
Use the <audio> tag to play an audio file in a web page
<audio autoplay="autoplay" controls="controls">
<source src="/assets/Doctor_Who_theme_excerpt.ogg" />
<p>Your browser does not support the audio element.</p>
</audio>
@webapprentice
webapprentice / tutorial_6_demo_1.html
Last active December 27, 2015 17:09
Play an audio file using JavaScript
<script>
window.AudioContext = (function(){
return window.webkitAudioContext || window.AudioContext ;
})();
// Global variables
var audioContext;
var audioBuffer = 0;
var audioUrl = "/assets/Doctor_Who_theme_excerpt.ogg";
@webapprentice
webapprentice / tutorial_7_example_1.html
Created November 7, 2013 18:39
Embed a live updating Twitter Timeline into a web page
<a class="twitter-timeline" href="https://twitter.com/BBCWorld" data-widget-id="395313647477481472">Tweets by @BBCWorld</a>
<script>
!function(d,s,id){
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+"://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
@webapprentice
webapprentice / tutorial_8_example_1.html
Created November 7, 2013 18:42
Use Google fonts in a web page
<style>
@import url(http://fonts.googleapis.com/css?family=PT+Sans);
@import url(http://fonts.googleapis.com/css?family=Cinzel);
@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed);
@import url(http://fonts.googleapis.com/css?family=Fondamento);
p {
font-size: 18px;
}
.font1 {
@webapprentice
webapprentice / tutorial_12_example_1.html
Created November 7, 2013 18:50
Use the highcharts.js JavaScript library to display a graph in a page
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="width: 800px; height: 400px; margin: 0 auto; border: 1px solid black;"></div>
<script>
$(function () {
$('#container').highcharts({
title: {
text: 'Registered Syrian Refugees',
@webapprentice
webapprentice / tutorial_9_example_1.html
Created November 7, 2013 18:44
Embed a video from Vimeo in a web page
<iframe src="//player.vimeo.com/video/49643332" width='500' height='281' frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
@webapprentice
webapprentice / tutorial_10_example_1.html
Created November 7, 2013 18:45
Embed a Bing Map in a web page
<div>
<iframe width="500" height="400" frameborder="0"
src="http://www.bing.com/maps/embed/viewer.aspx?v=3&cp=48.858601~2.293980&lvl=15&w=500&h=400&sty=r&typ=d&pp=&ps=&dir=0&mkt=en-us&src=SHELL&form=BMEMJS">
</iframe>
<div style="margin: 12px 0 0 0;">
<a target="_blank" href="http://www.bing.com/maps/?cp=48.858601~2.293980&sty=r&lvl=15&sp=&mm_embed=map">View Larger Map</a>&nbsp; |&nbsp;
<a target="_blank" href="http://www.bing.com/maps/?cp=48.858601~2.293980&sty=r&lvl=15&rtp=~pos.48.858601_2.293980____&mm_embed=dir">Get Directions</a>&nbsp; |&nbsp;
<a target="_blank" href="http://www.bing.com/maps/?cp=s48sq3h5r1fn&sty=b&lvl=18&sp=&mm_embed=be">View Bird's Eye</a>
</div>
@webapprentice
webapprentice / tutorial_11_demo_1.html
Last active December 27, 2015 17:09
Embed a public Google Calendar in a web page
<iframe src="https://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=craic.web.apprentice%40gmail.com&amp;color=%232952A3&amp;ctz=America%2FLos_Angeles" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
@webapprentice
webapprentice / tutorial_13_example_1.html
Last active December 27, 2015 17:29
Embed multi-page documents hosted on Scribd in a web page
<p style=" margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;">
<a title="View Apple Samsung Verdict on Scribd" href="http://www.scribd.com/doc/103850190/Apple-Samsung-Verdict" style="text-decoration: underline;" >Apple Samsung Verdict</a>
by
<a title="View Mashable's profile on Scribd" href="http://www.scribd.com/Mashable" style="text-decoration: underline;" >Mashable</a></p>
<iframe class="scribd_iframe_embed" src="//www.scribd.com/embeds/103850190/content?start_page=1&view_mode=scroll&access_key=key-15dmx1n9d44whpgh7s79&show_recommendations=false" data-auto-height="false" data-aspect-ratio="0.772727272727273" scrolling="no" id="doc_159" width="400" height="600" frameborder="0"></iframe>