Skip to content

Instantly share code, notes, and snippets.

View maullerz's full-sized avatar

Loginov Roman maullerz

View GitHub Profile
poweruser@bdx-cc-01:/rest/u/apps/sfk-apps-interactive$ cat /etc/nginx/sites-enabled/sfk*
server {
listen 17100 default_server deferred;
root /rest/u/apps/sfk-apps-interactive/current/public;
access_log /var/log/nginx/sfk-apps-interactive-static-access.log;
error_log /var/log/nginx/sfk-apps-interactive-errors.log;
gzip on;
gzip_comp_level 3;
gzip_proxied expired no-cache no-store private auth;
gzip_disable msie6;
@maullerz
maullerz / # Sublime Emmet JSX Reactjs.md
Created May 10, 2016 12:51 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
@maullerz
maullerz / Bindings.md
Last active September 30, 2016 14:59
@maullerz
maullerz / links - writing fast code for react and typescript.md
Created January 26, 2021 10:50 — forked from victor-homyakov/links - writing fast code for react and typescript.md
Ссылки для презентации "Код на React и TypeScript, который работает быстро"
@maullerz
maullerz / index.md
Created August 2, 2022 05:44 — forked from iamakulov/index.md
Proxying api.my-app.com under my-app.com/api, using CloudFront or Cloudflare

Here’s how to make api.my-app.com available under my-app.com/api, using CloudFront or Cloudflare.

CloudFront

If both my-app.com and api.my-app.com are hosted in AWS, you can route requests to these instances using the CloudFront CDN.

Here’s what you’ll need to do:

  1. Create a CloudFront distribution
@maullerz
maullerz / nginx.conf
Created April 3, 2024 03:23 — forked from hlubek/nginx.conf
Nginx reverse proxy with caching for Next.js with imgproxy
# Based on https://steveholgado.com/nginx-for-nextjs/
# - /var/cache/nginx sets a directory to store the cached assets
# - levels=1:2 sets up a two‑level directory hierarchy as file access speed can be reduced when too many files are in a single directory
# - keys_zone=STATIC:10m defines a shared memory zone for cache keys named “STATIC” and with a size limit of 10MB (which should be more than enough unless you have thousands of files)
# - inactive=7d is the time that items will remain cached without being accessed (7 days), after which they will be removed
# - use_temp_path=off tells NGINX to write files directly to the cache directory and avoid unnecessary copying of data to a temporary storage area first
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
upstream nextjs_upstream {
@maullerz
maullerz / esm-package.md
Created May 4, 2024 13:56 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.