Skip to content

Instantly share code, notes, and snippets.

View SteveViss's full-sized avatar

Steve Vissault SteveViss

View GitHub Profile
@SteveViss
SteveViss / native-lands.R
Created January 22, 2024 14:42
Load native lands from geojson
download.file("https://native-land.ca/wp-content/themes/NLD-2021/files/indigenousTerritories.json",destfile="indigenousTerritories.json",method="libcurl")
iTerr <- geojsonsf::geojson_sf("indigenousTerritories.json")
plot(iTerr["Name"])
alias r="radian"
alias docker-compose='docker compose'
alias cdg="cd git"
alias cdn="cd Nextcloud"
alias c="code ."
alias n="nautilus ."
alias kubectl="microk8s kubectl"
@SteveViss
SteveViss / vascan.R
Last active July 3, 2018 23:43
Obtenir l'information taxonomique depuis un nom commun FR
vascan_lookup <- function(search) {
ress <- "http://data.canadensys.net/vascan/api/0.1/search.json"
if(length(search) == 1L){
return(httr::GET(ress, query = list(q = search)))
} else {
responses <- list()
@SteveViss
SteveViss / doParallel_MultiNodes.r
Last active August 3, 2018 17:04
Fitting lm on fake data using 2 nodes
# Parallelize linear regressions using 4 nodes
# Open an interactive job
# with the following command line
# salloc --time=1:0:0 --ntasks=100
#0. Packages loading
library(doParallel)
#1. Init the cluster of SOCKETS
@SteveViss
SteveViss / FakeFiles
Created February 26, 2015 15:29
Create fake files for testing procedure using batch
#!/bin/bash
# Script to create empty files in the specified folder.
if [ -z "$1" ]; then
echo "Enter the destination folder as a parameter."
exit
elif [ ! -d "$1" ]; then
echo "No such folder."
exit
fi
@SteveViss
SteveViss / old_kernels
Created August 21, 2014 19:43
Delete old kernels on Ubuntu
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
@SteveViss
SteveViss / conky_setup
Last active August 29, 2015 14:04
Conky config file
use_xft yes
xftfont Ubuntu Condensed:size=9
xftalpha 0.8
override_utf8_locale yes
update_interval 5.0
total_run_times 0
own_window yes
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 155
@SteveViss
SteveViss / post_trait_NRCan.sh
Created April 19, 2014 23:07
Post traitment on climate data from NRCan using ANUSPLIN
#!/bin/bash
echo -n "Export folder empty or full (yes or no) ? "
read POST
echo -n "Import on remote or local server? "
read CON
TRAIT=~/Documents/QUICC_FOR/Climat_data_trait/
EXPORT=~/Documents/QUICC_FOR/Climat_data_trait/Export_climat
@SteveViss
SteveViss / Niche_Model_WM
Created March 8, 2014 16:24
Simple rules yield complex food webs (2000)Richard J. Williams & Neo D. MartinezNiche Model
### Niche-Food Web Model - Williams et Martinez
#### Parameters
# S = Number of trophic species
# C = Network connectance [0,0.5[
nicheFW <- function(S,C){
### Model