This file contains hidden or 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
require 'open-uri' | |
require "rexml/document" | |
# | |
# | |
# Distance between two addresses using google maps and the Haversine forumla | |
# (http://en.wikipedia.org/wiki/Haversine_formula) based on the JS implementation | |
# (http://www.movable-type.co.uk/scripts/latlong.html) | |
# | |
# |
This file contains hidden or 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
# #Nanoc validation task | |
# | |
# To use this validation task you need the w3c_validators gem | |
# gem install w3c_validators | |
# and run rake validate on your project root | |
# | |
require 'yaml' | |
require 'w3c_validators' | |
include W3CValidators |
This file contains hidden or 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
# #WCAG Basic wadus | |
# | |
# Using http://achecker.ca/checker/index.php | |
require 'raakt' | |
desc "WCAG basic wadus" | |
task :wcag_validate do | |
# perform a setup of all our variables | |
setup |
This file contains hidden or 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
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
(function(){ | |
var index; | |
function log(){ | |
console.log(index); |
This file contains hidden or 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
// 1. Write a class to support the following code: | |
// var thomas = new Person('Thomas'); | |
// var amy = new Person('Amy'); | |
var Person = function(name) { | |
this.name = name; | |
} | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); |
This file contains hidden or 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
// Para rectificar con http://gist.github.com/500794 | |
// Part 1. | |
// Implement a function prototype extension that caches function results for | |
// the same input arguments of a function with one parameter. | |
// | |
// For example: | |
// Make sin(1) have the result of Math.sin(1), but use a cached value | |
// for future calls. | |
// |
This file contains hidden or 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 id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ |
This file contains hidden or 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
body { | |
font-family: sans-serif; | |
} | |
strong { | |
display: inline-block; | |
padding: 4px; | |
width: 240px; | |
background: pink; | |
text-align: right | |
} |
This file contains hidden or 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
set dontplay to 0 | |
tell application "Keynote" | |
start from slide 1 of front slideshow | |
end tell | |
set volume output volume 80 | |
repeat | |
tell application "Keynote" | |
tell front slideshow |
OlderNewer