Skip to content

Instantly share code, notes, and snippets.

View droganaida's full-sized avatar

Aida Drogan droganaida

View GitHub Profile
@droganaida
droganaida / koa-app.js
Created August 13, 2023 14:13
Simple SSL Koa JS server (HTTPS for Localhost)
const Koa = require('koa');
const path = require('path');
const serve = require('koa-static');
const http = require('http');
const https = require('https');
const fs = require('fs');
const commonDir = path.join(__dirname, '..', 'Client');
const app = new Koa();
@droganaida
droganaida / UE4 Pixel Strimming fix Chrome bug.js
Last active March 28, 2022 09:59
Find function webRtcPlayerObj.onWebRtcOffer in app.js file, add removeExtmapAllowMixed(offer); in the beginning of IF. Then add function removeExtmapAllowMixed(desc) to remove a=extmap-allow-mixed
webRtcPlayerObj.onWebRtcOffer = function (offer) {
if (ws && ws.readyState === WS_OPEN_STATE) {
removeExtmapAllowMixed(offer);
let offerStr = JSON.stringify(offer);
console.log(`-> SS: offer:\n${offerStr}`);
ws.send(offerStr);
}
};
function removeExtmapAllowMixed(desc) {
//HLSL Animated Normal Map for Unreal Engine material (custom node)
float2 uv = iCoord.xy / iResolution.xy; // iCoord - UV, iResolution - Float2(1,1)
float h = 0.6 * iTexture; // iTexture - RGBA (Float4)
float w = 40.0;
float3 n = normalize(float3(ddx(h) * w, ddy(h) * w, 1.0));
return float4(n * 0.5 + 0.5,1.0);
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>CSS Read more / Read less button | demo by #BlondieCode</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Common styles */
html, body {
min-height: 100vh;
@droganaida
droganaida / svg-animation-demo.html
Created March 19, 2020 17:16
Some cool SVG animations (move, rotate, opacity, text on path). No JavaScript.
<html>
<head>
<title>SVG animation demo dy #BlondieCode</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body{
min-height: 100vh;
margin: 0;
padding: 0;
@droganaida
droganaida / lazy-loading.html
Created January 23, 2020 08:42
Intersection Observer + custom lazy loading demo
<html>
<head>
<title>Lazy loading by #Blondiecode</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, "Helvetica Neue", Helvetica, serif;
}
footer {
@droganaida
droganaida / rainbowButtons.html
Last active April 15, 2022 07:07
Rainbow gradient for the group of buttons depending on position
<html>
<head>
<title>Common CSS background on button group by #BlondieCode</title>
<style>
body {
display: flex;
flex-direction: column;
}
footer {
text-align: center;
@droganaida
droganaida / bluebird-test.js
Last active March 18, 2020 10:25
Asynchronous vs synchronous vs synchronous asynchronous loop with delay or without
const request = require("request");
const Promise = require('bluebird');
const getUrl = Promise.promisifyAll(request);
let requestsSent = 0;
let requestsSuccess = 0;
//======================= jsonGet Function =======================//
@droganaida
droganaida / rightClickMenu.html
Created February 12, 2019 19:53
Custom context (right-click) menu on the web page by #BlondieCode
<!DOCTYPE html>
<html lang="ru" dir="ltr">
<head>
<title>#BlondieCode Правый мышеклик</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body {
width: 100%;
height: 100%;
@droganaida
droganaida / clusterDemo.js
Last active February 7, 2022 01:55
Node.js Cluster demo. Fork(), cluster events, lifecycle of workers, messages between workers and master.
const cluster = require('cluster');
const http = require('http');
const port = 6006;
const requestHandler = (request, response) => {
response.writeHead(200);
if (request.url === '/error') {
// uncaught exception