Skip to content

Instantly share code, notes, and snippets.

Avatar
🎓
Studying

Alex Solomaha CyanoFresh

🎓
Studying
View GitHub Profile
View Preventing-Puppeteer-Detection.md

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@kocisov
kocisov / next_nginx.md
Last active Jul 22, 2021
How to setup next.js app on nginx with letsencrypt
View next_nginx.md
@tom--
tom-- / Random bytes, ints, UUIDs in PHP.md
Last active Oct 8, 2020
PHP random bytes, integers and UUIDs
View Random bytes, ints, UUIDs in PHP.md

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@jtrefry
jtrefry / Win10-64bit-npm.md
Last active Jul 10, 2021
Configuring Windows 10 (64-bit) for npm and node-gyp
View Win10-64bit-npm.md
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
@thoop
thoop / nginx.conf
Last active Jul 2, 2021
Official prerender.io nginx.conf for nginx
View nginx.conf
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@nikmartin
nikmartin / A: Secure Sessions Howto
Last active Jun 17, 2021
Secure sessions with Node.js, Express.js, and NginX as an SSL Proxy
View A: Secure Sessions Howto
Secure sessions are easy, but not very well documented.
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy:
The desired configuration for using NginX as an SSL proxy is to offload SSL processing
and to put a hardened web server in front of your Node.js application, like:
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT]
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now.
@paulkaplan
paulkaplan / colorTempToRGB.js
Last active Jul 11, 2021
Color Temperature to RGB
View colorTempToRGB.js
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.)
function colorTemperatureToRGB(kelvin){
var temp = kelvin / 100;
@martinsik
martinsik / chat-frontend.js
Last active Jul 10, 2021
Node.js chat frontend and server
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;