Skip to content

Instantly share code, notes, and snippets.

View demiters's full-sized avatar
🍕
Test status please ignore

Arturs Demiters demiters

🍕
Test status please ignore
  • CodeCraft
  • Riga, Latvia
View GitHub Profile
@demiters
demiters / swap.sh
Created July 20, 2020 13:54
Creating swap space on Ubuntu 18.04 - 20.04
#!/bin/bash
# Creates 8GB of swap space and persists some recommended settings for servers
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
@demiters
demiters / index.html
Created December 13, 2017 19:03
Simple progress bar logic with materializecss.com and jQuery
<div id="progress" class="progress">
<div id="progressBar" class="determinate" style="width: 0%"></div>
</div>
@demiters
demiters / getJSON.js
Last active December 13, 2017 18:31
Shortest getJSON implementation with fetch. Call: `const data = await getJSON('https://api.com')`
const getJSON = async (url) => await fetch(url)
.then(res => res.json())
.catch(err => console.error(`${err.message} (${url})`));