Skip to content

Instantly share code, notes, and snippets.

View ra100's full-sized avatar
🦙

Rastislav Švarba ra100

🦙
View GitHub Profile
@ra100
ra100 / fonts.html
Last active April 1, 2024 19:37
FSFilm Pipeline diagram
<html>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Antonio&display=swap" rel="stylesheet">
</head>
</html>
@ra100
ra100 / cloudSettings
Last active March 26, 2020 06:59
cloudSettings
{"lastUpload":"2020-01-23T08:46:58.022Z","extensionVersion":"v3.4.3"}
@ra100
ra100 / starship.toml
Created November 9, 2019 18:37
Starshipt config
add_newline = false
prompt_order = [
"username",
"hostname",
"kubernetes",
"package",
"dotnet",
"golang",
"java",
"nodejs",
@ra100
ra100 / apod.js
Last active September 9, 2019 12:05
Download Astronomy Picture of the Day from NASA for specified dates
#!/usr/bin/env node
/**
* script to get NASA APOD pictures in HD quality for specified period of time
* you need NodeJS v12+ to use shebang, and you need jq and wget
* Get the API key from NASA https://api.nasa.gov/index.html
* usage: NASA_API_KEY='asdg' APOD_FROM=2019-09-09 APOD_TO="2000-01-01" ./apod.js
*/
const {exec} = require('child_process')
@ra100
ra100 / Node.js array.map benchmark
Last active August 30, 2019 17:06
Benchmark on different node.js version
#!/bin/bash
export NODE_ENV=production
function benchmark {
echo $NODE_ENV
nvm use "$1"
rm -rf node_modules
npm i
node for-map.js >> results.txt
@ra100
ra100 / README.md
Last active July 30, 2019 03:30
Node.js homework

Task

Implement API server (in Node.js) based on the API specification.

It shouldn't take more than one hour to do this.

We like:

  • Tests
  • Nice commit messages
  • Working code
@ra100
ra100 / arrays-spread-concat.js
Last active June 27, 2019 07:53
Perfomance comparison of arrays
#!/usr/bin/env node
const Benchmark = require('benchmark')
const spread = (d1, d2) => () => {
const d = [...d1, ...d2]
}
const concat = (d1, d2) => () => {
const d = d1.concat(d2)
@ra100
ra100 / index.html
Created November 2, 2018 07:43
elephant-carpaccio
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous">
</script>
</head>
<h1>Elephant Shop</h1>
<div>
<h3>We have</h3>
<table>
@ra100
ra100 / index.html
Last active November 2, 2018 13:05
webrtc
<!DOCTYPE html>
<html>
<head>
<title>Transmit text</title>
</head>
<body>
<h1>ALICE</h1>
<div class="text">test</div>
@ra100
ra100 / evaluation.js
Last active January 28, 2018 17:53
Normalize relative scales across multiple evaluations.
const DEFAULT_MODIFIER = { multiplier: 1, offset: 0, error: Number.MAX_VALUE }
const users = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
const sourceData = [
{ A: 1, B: 0.8, C: 0.34, D: 0.33, E: 0 },
{ B: 1, A: 0.9, C: 0.85, F: 0.5, J: 0.1, G: 0 },
{ B: 1, H: 0.7, D: 0.5, J: 0.3, F: 0 },
{ C: 1, A: 0.9, B: 0.8, I: 0.6, E: 0.1, J: 0 }
]
const getAverage = arr =>