Skip to content

Instantly share code, notes, and snippets.

View vgaltes's full-sized avatar

Vicenç García Altés vgaltes

View GitHub Profile
@vgaltes
vgaltes / Prova de Gist en R
Created October 5, 2012 15:06
Prova Gist
# load url and packages
url <- "http://www2.idrottonline.se/UppsalaLK/KungBjorn-loppet/KungBjorn-loppet2012/Resultat2012/"
require(plyr)
require(XML)
require(RCurl)
# get & format the data
doc <- getURL(url)
doc2 <- htmlTreeParse(doc, asText = TRUE, useInternalNodes = TRUE)
@vgaltes
vgaltes / This example 1
Last active August 29, 2015 14:17
This example 1
<script>
var hello = 'Hello from the outer space';
var aObject = {
hello : 'Hello from the earth'
}
var sayHello = function(){
console.log(this.hello);
}
@vgaltes
vgaltes / This example 2
Created March 29, 2015 15:31
This example 2
<script>
var aObject = {
aFunction: function(){
console.log(this);
var anotherFunction = function(){
console.log(this);
var yetAnotherFunction = function(){
console.log(this);
}();
@vgaltes
vgaltes / This example 3
Created March 29, 2015 15:45
This example 3
<script>
var aObject = {
aFunction: function(){
console.log(this);
var that = this;
var anotherFunction = function(){
console.log(that);
var yetAnotherFunction = function(){
console.log(that);
@vgaltes
vgaltes / This example 4
Created March 29, 2015 15:52
This example 4
<script>
var Country = function(name){
this.name = name;
}
var catalunya = new Country('Catalunya');
console.log(catalunya.name);
@vgaltes
vgaltes / This example 5
Created March 29, 2015 16:06
This example 5
<script>
var monica = {};
var setLocation = function(location){
this.location = location;
}
setLocation.apply(monica, ['London']);
@vgaltes
vgaltes / gist:8900b49681c56d0c792b
Created April 23, 2015 20:55
FSharp FizzBuzz Kata - Module declaration
module FizzBuzz.Tests
@vgaltes
vgaltes / gist:c1ae19b0ab531ca3ba69
Last active August 29, 2015 14:19
FSharp FizzBuzz Kata - include NUnit
open NUnit.Framework
@vgaltes
vgaltes / gist:58750e89636880cda7b8
Last active August 29, 2015 14:19
FSharp FizzBuzz Kata - First test
[<Test>]
let ``the number 1 is returned as is`` () =
Assert.That ("1" = fizzBuzz 1)
@vgaltes
vgaltes / gist:00a56221ddaa38423688
Created April 23, 2015 21:30
FSharp FizzBuzz Kata - Define fizzBuzz function
let fizzBuzz input = ""