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 mp3 = document.createElement("audio"); | |
mp3.setAttribute('src', 'http://example.com/track.mp3'); | |
mp3.load(); | |
document.documentElement.appendChild(mp3); | |
mp3.play(); | |
// use mp3.pause() to pause :=) | |
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
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb | |
sudo apt-get update | |
sudo apt-get install git esl-erlang elixir postgresql nodejs nodejs-legacy npm | |
sudo npm -g install brunch@1 | |
mix local.hex | |
mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.1/phoenix_new-1.1.1.ez | |
git clone https://github.com/eikes/phoenix_guides_server.git |
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 settings = { | |
state : { | |
"orderBy" : "lastname", | |
"filters" : { | |
"category" : ["Bird"], | |
"continent" : ["Africa"] | |
} | |
}, | |
items : example_items, | |
facets : { |
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
function loadFacebook() { | |
$script("http//connect.facebook.net/en_US/all.js#xfbml=1"); | |
} | |
minwidth(600, loadFacebook); |
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
minwidth(480, null, enhanceMobile, true); |
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
minwidth(480, moveSomething, moveItBack); |
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 sidebar = document.getElementById("sidebar"); | |
var sidebarElements = document.getElementsByClassName("sidebarElements"); | |
// here is the function call: | |
relocate(480, sidebarElements, sidebar); |
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
// Function to determine the width of any element in pixel: | |
getElementWidth = function (node) { | |
var ow = node.offsetWidth, | |
cs = node.currentStyle && node.currentStyle["width"] | |
|| getComputedStyle && getComputedStyle(node, null).getPropertyValue("width"), | |
result = parseFloat(ow || cs); | |
if (cs && cs.match(/%/)) | |
return (parseFloat(cs) / 100) * getElementWidth(node.parentNode); | |
if (isNaN(result) || result == 0) | |
return getElementWidth(node.parentNode); |
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
String.prototype.toUnicode = function (){ | |
function pad(t) { | |
return t.length == 4 ? t : pad("0" + t); | |
} | |
var r=""; | |
for (var i = 0; i < this.length; i++) { | |
r += "\\u" + pad(this.charCodeAt(i).toString(16)); | |
} | |
return r; | |
} |
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
/* | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
* MIT license | |
* | |
* Includes enhancements by Scott Trenda <scott.trenda.net> | |
* and Kris Kowal <cixar.com/~kris.kowal/> | |
* | |
* Accepts a date, a mask, or a date and a mask. | |
* Returns a formatted version of the given date. |