Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
building stuff

Viliam Simko vsimko

💭
building stuff
View GitHub Profile
View node-openalpr-example-with-eu-region.js
// Created by Viliam Simko
// using the example from https://github.com/Sneko/node-openalpr.git
const openalpr = require("node-openalpr")
const fs = require('fs')
async function identify(path) {
return new Promise((resolve, reject) => {
openalpr.IdentifyLicense(path, (error, output) =>
error
View wikimedia-stream.md
# 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}'
@vsimko
vsimko / RemoteIteratorWrapper.scala
Created Aug 30, 2017 — forked from timvw/RemoteIteratorWrapper.scala
scala wrapper for hadoop remote iterator
View RemoteIteratorWrapper.scala
import org.apache.hadoop.fs.RemoteIterator
/**
* Converts RemoteIterator from Hadoop to Scala Iterator that provides all the familiar functions such as map,
* filter, foreach, etc.
*
* @param underlying The RemoteIterator that needs to be wrapped
* @tparam T Items inside the iterator
* @return Standard Scala Iterator
*/
View myscatter_lower.R
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)
View magic-bibtex-style-tweak.tex
\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
View node-red-notes.md

How to install node-red:

mkdir mynodered
cd mynodered
yarn add --network-concurrency 1 node-red
./node_modules/.bin/node-red
View hyperspectral-corrplot-analysis.R
# 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]])
View video-to-frames-kafka.sh
# 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"
View lsa-example.R
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)
You can’t perform that action at this time.