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
import os | |
import pandas as pd | |
import datetime | |
import re | |
def get_datafile_list(directory, limit): | |
datafile_list = [] | |
objects = os.listdir(directory) | |
i = 0 |
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
# Code courtesy of William Morris | |
# Requires setting your personal token, and installing this: | |
# apt-get install libcurl4-openssl-dev libssl-dev | |
install.packages("finbif") | |
install.packages("ggplot2") | |
library(finbif) | |
library(ggplot2) |
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
Lähde: | |
Talvilintulaskenta - http://tun.fi/HR.39 [metadata], Creative Commons Nimeä | |
Aineistolataus Lajitietokeskuksesta http://tun.fi/HBF.59676 | |
id yearDecember WBC.sorbusBerriesAtCensus | |
http://tun.fi/JX.100009 1990 1 | |
http://tun.fi/JX.100131 1990 1 | |
http://tun.fi/JX.100396 1990 1 | |
http://tun.fi/JX.100605 1990 1 | |
http://tun.fi/JX.100902 1990 2 |
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
import pafy | |
import cv2 | |
import math | |
from datetime import datetime | |
url = "add url here" | |
video = pafy.new(url) | |
best = video.getbest(preftype="mp4") |
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
from PIL import Image | |
import colorsys | |
def rgb2hsv(rgb): | |
r = rgb[0] / 255 | |
g = rgb[1] / 255 | |
b = rgb[2] / 255 | |
hsvRaw = colorsys.rgb_to_hsv(r, g, b) |
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
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
?> | |
<style> | |
.number | |
{ | |
text-align: right; | |
} | |
</style> | |
<pre> |
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
// Regex for matching strings that do not contain comma: | |
// BAsed on: http://stackoverflow.com/questions/717644/regular-expression-that-doesnt-contain-certain-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
<?php | |
// Getting species/taxon images from EOL | |
$species = $_GET['species']; | |
$species = str_replace(" ", "+", $species); | |
// Id | |
// Documentation: http://eol.org/api/docs/pages | |
$idUrl = "http://eol.org/api/search/1.0.json?q=" . $species . "&page=1&exact=false&filter_by_taxon_concept_id=&filter_by_hierarchy_entry_id=&filter_by_string=&cache_ttl="; |
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
/** | |
* Return base url automatically for Codeigniter | |
* Source: http://snipplr.com/view/16894/codeigniter-automatic-base-url-configuration/ | |
*/ | |
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); | |
$config['base_url'] .= "://".$_SERVER['HTTP_HOST']; | |
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); |
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
/** | |
* Gets the last commit date from .git repository | |
* @param string $gitLocation location of .git/logs/HEAD | |
* @return string date of last commit YYYY-mm-dd | |
*/ | |
function gitLastCommitInfo($gitLocation) | |
{ | |
$commitArray = file($gitLocation); // All commits from file | |
$lastCommit = array_pop($commitArray); // Latest commit | |
$lastCommitArray = explode("\t", $lastCommit); |