Skip to content

Instantly share code, notes, and snippets.

@Velunce
Velunce / horizontal-slide-without-js.html
Last active June 12, 2025 13:20
How to implement a swiper in HTML without JS.
<!DOCTYPE html>
<html>
<head>
<title>Horizontal slide</title>
<style type="text/css">
.slide-box{
display: -webkit-box;
overflow-x: scroll;
-webkit-overflow-scrolling:touch;
}
@Velunce
Velunce / responsiveFont.js
Created June 12, 2025 13:16
This JavaScript snippet dynamically adjusts the font size of the body and sets the rem unit based on the viewport width. It ensures that the font size is responsive and adapts to different screen sizes, enhancing readability on mobile devices. The script also detects support for 0.5px borders for better styling on high-DPI displays.
(function flexible (window, document) {
var docEl = document.documentElement
var dpr = window.devicePixelRatio || 1
// adjust body font size
function setBodyFontSize () {
if (document.body) {
document.body.style.fontSize = (12 * dpr) + 'px'
}
else {
@Velunce
Velunce / nginx-tuning.md
Created February 6, 2018 06:20 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@Velunce
Velunce / nginx-tuning.md
Created February 6, 2018 06:20 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.