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
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
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
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
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
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
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 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
{% block collection_widget %} | |
{% spaceless %} | |
<div class="collection"> | |
{% if prototype is defined %} | |
{% set attr = attr|merge({'data-prototype': block('collection_item_widget') }) %} | |
{% endif %} | |
<div {{ block('widget_container_attributes') }}> | |
{{ form_errors(form) }} | |
<ul> | |
{% for prototype in form %} |
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
/* | |
* Copyright (C) 2012 Eike Send | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to | |
* deal in the Software without restriction, including without limitation the | |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
* sell copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |