Skip to content

Instantly share code, notes, and snippets.

View vsimko's full-sized avatar
💭
building stuff

Viliam Simko vsimko

💭
building stuff
View GitHub Profile
# install required packages
sudo apt install mplayer kafkacat
# create a separate dir for the frames
mkdir frames
cd frames
# download video to vid.avi
curl -o vid.avi "http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi"
# these libraries required corrplot 0.84, download from github
# install.packages("devtools")
# devtools::install_github("taiyun/corrplot")
library(raster)
library(corrplot)
citation("corrplot")
s <- stack("~/Work/biggis/data/data-julian/Auto150_georef.tif")
nlayers(s)
plot(s[[1]])

How to install node-red:

mkdir mynodered
cd mynodered
yarn add --network-concurrency 1 node-red
./node_modules/.bin/node-red
\makeatletter
\renewenvironment{thebibliography}[1]{
\section*{\refname}%
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}{
\leftmargin0pt
\@openbib@code
\usecounter{enumiv}
}%
\let\p@enumiv\@empty
myscatter_lower <- function(data,
point_color = "white",
border_color = NA,
point_size = 3) {
drawcell <- function(fx, fy, datax, datay) {
oldpar <- par(mar = c(0,0,0,0), bg = "white")
on.exit(par(oldpar), add = TRUE)
# show whole messages as formatted JSON
curl -s https://stream.wikimedia.org/v2/stream/recentchange | grep data | sed 's/^data: //g' | jq .
# show only title and comment
curl -s https://stream.wikimedia.org/v2/stream/recentchange | grep data | sed 's/^data: //g' | jq '{title:.title, comment:.comment}'
// sending-a-file-as-multipart-through-xmlhttprequest
https://stackoverflow.com/questions/9395911/sending-a-file-as-multipart-through-xmlhttprequest
// change the id `USE-YOUR-ID`
const img = document.getElementById('USE-YOUR-ID');
// extracts image data from <img> element through canvas
const canvas = document.createElement('canvas');
library(lsa)
# create some sample data in temp dir
td = tempfile()
dir.create(td)
write(c("dog", "cat", "mouse"), file = paste(td, "D1", sep = "/"))
write(c("ham", "mouse", "sushi"), file = paste(td, "D2", sep = "/"))
write(c("dog", "pet", "pet"), file = paste(td, "D3", sep = "/"))
data(stopwords_en)
@vsimko
vsimko / biggis-docs-new-page-howto.md
Last active January 15, 2018 13:20
How to add new page into biggis-docs
# install required stuff (you should have already installed it anyways)
pip install --user mkdocs
pip install --user mkdocs-material
sudo apt install nodejs

# clone the repo
git clone https://github.com/biggis-project/biggis-docs.git
cd biggis-docs