Skip to content

Instantly share code, notes, and snippets.

View LetItRock's full-sized avatar
👨‍💻
coding...

Paweł Tymczuk LetItRock

👨‍💻
coding...
View GitHub Profile
import { useState, useEffect } from "react";
import styled from "styled-components";
import VisuallyHidden from "components/visuallyHidden";
import Input from "components/customInput";
import CodeBlock from "components/codeBlock";
import Result from "components/result";
import Warning from "components/warning";
import oneDecimal from "utils/oneDecimal";
import GithubIcon from "components/githubIcon";
@LetItRock
LetItRock / webpack_offline_plugin_runtime.ts
Last active January 23, 2020 20:34
Webpack Offline plugin - runtime events - show new updates notification once
import { showSuccessBanner } from '@rs/ui-toolkit';
import moment from 'moment';
import * as OfflinePluginRuntime from 'offline-plugin/runtime';
const SW_UPDATE_READY = 'SW_UPDATE_READY';
const WEBPACK_OFFLINE_CACHE_PREFIX = 'webpack-offline:';
const LAST_UPDATED_DATE = 'LAST_UPDATED_DATE';
// dates from cache names sorted
const getDatesFromCacheNames = (keys: string[]) =>
@LetItRock
LetItRock / nginx.conf
Created November 12, 2018 04:37 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.changes 'diff --cached'
@LetItRock
LetItRock / .css
Created August 18, 2018 11:40
Css media queries for small and medium screens
@media screen and (min-width: 55rem) and (max-width:90rem) {
}
@media screen and (max-width: 55rem) {
}
@LetItRock
LetItRock / Dockerfile
Last active August 1, 2018 11:58
nginx ssl configuration
FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY ./build /usr/share/nginx/html
RUN mkdir -p /etc/letsencrypt/archive/sotm.grapeup.com
WORKDIR /etc/letsencrypt/archive/sotm.grapeup.com
COPY fullchain1.pem ./fullchain1.pem
COPY privkey1.pem ./privkey1.pem
worker_processes 1;
daemon off;
error_log /home/vcap/app/nginx/logs/error.log;
events { worker_connections 1024; }
http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent'
' ########## BEGINNING OF HEADER LOG ########## '
worker_processes 1;
daemon off;
events {}
# usage: sudo nginx -c ~/workspace/mercury-pilot/nginx/nginx-local.conf
http {
include /usr/local/etc/nginx/mime.types;
@LetItRock
LetItRock / S3-Static-Sites.md
Created April 27, 2018 20:46 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@LetItRock
LetItRock / History|-102cc548|entries.json
Last active May 22, 2022 14:12
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/pavlotymchuk/projects/js/rsapi/config/database.yml","entries":[{"id":"Ssc9.yml","timestamp":1652354899010}]}