Skip to content

Instantly share code, notes, and snippets.

View prl900's full-sized avatar

Pablo Rozas Larraondo prl900

View GitHub Profile
package main
import (
"encoding/gob"
"fmt"
"image"
"image/png"
"net/http"
"strconv"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prl900
prl900 / gcp_modis_uploader.go
Created April 6, 2018 05:05
Upload local copy of Modis tiles
package main
import (
"fmt"
"io/ioutil"
//"os"
"path"
"cloud.google.com/go/storage"
"golang.org/x/net/context"
@prl900
prl900 / aws_modis_downloader.go
Created April 6, 2018 04:39
Downloader for AWS Modis data
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"path"
"os"
"io"
package main
import (
"bufio"
"golang.org/x/image/tiff"
"image/png"
"os"
)
func main() {
@prl900
prl900 / parser.py
Created February 3, 2018 12:09
Python CSV parser sample code
FILE_NAME = "CSVFile.csv"
def exists(name, persons):
for person in persons:
if name == person[0]:
return True
return False
def get_phone(name, persons):
for person in persons:
@prl900
prl900 / parser.go
Created February 3, 2018 11:51
Go CSV parser sample code
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
const csvFile = "CSVFile.csv"
@prl900
prl900 / parser.hs
Created February 3, 2018 11:42
Haskell CSV parser sample code
split :: String -> [String]
split [] = [""]
split (c:cs) | c == ',' = "" : rest
| otherwise = (c : head rest) : tail rest
where rest = split cs
nameexists :: String -> [[String]] -> Bool
nameexists a [] = False
nameexists a (x:xs) | x !! 0 == a = True
| otherwise = nameexists a xs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prl900
prl900 / wcs.py
Last active November 28, 2017 22:54
Sample script using owslib to perform a WCS request using logging
#!/usr/bin/env python
from owslib.wcs import WebCoverageService
import logging
def GetCapabilities(path):
if not path.startswith('http'):
print "Malformed path, should start with http"
return