Skip to content

Instantly share code, notes, and snippets.

@siakaramalegos
siakaramalegos / basic_router.jsx
Last active July 6, 2023 04:02
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@joech4n
joech4n / s3DuByPrefix.sh
Last active November 28, 2018 16:40
Get bucket size and object count by first level prefix (i.e. bucket/prefix1, bucket/prefix2)
#!/bin/sh
BUCKETNAME=mybucketname; REGION=us-east-1; for prefix in $(aws s3api list-objects --bucket $BUCKETNAME --delimiter '/' --output text --region $REGION |grep COMMONPREFIX |tail -n+2| awk '{print $2}'); do echo "Totals for $prefix"; aws s3 ls --summarize --human-readable --recursive s3://$BUCKETNAME/$prefix --region $REGION ; done |grep Total
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 15, 2024 17:21
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@koistya
koistya / React-Directory-Layout.md
Last active April 7, 2024 19:01
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css
@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.
@plentz
plentz / nginx.conf
Last active March 31, 2024 18:40
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@adamloving
adamloving / temporary-email-address-domains
Last active April 15, 2024 00:32
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com