Skip to content

Instantly share code, notes, and snippets.

View prettyirrelevant's full-sized avatar
💭
???

Isaac Adewumi prettyirrelevant

💭
???
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@andybeak
andybeak / dummy3_reverse_proxy.conf
Last active January 9, 2024 15:51
Nginx reverse proxy with SSL config example
# Read
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart#
# http://tautt.com/best-nginx-configuration-for-security/
# https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
#
# Generate your key with: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
# Generate certificate: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
server {
@feelinc
feelinc / UploadDirS3.py
Last active October 8, 2024 20:55
Upload folder contents to AWS S3
#!/usr/bin/python
import os
import sys
import boto3
# get an access token, local (from) directory, and S3 (to) directory
# from the command-line
local_directory, bucket, destination = sys.argv[1:4]
@subfuzion
subfuzion / curl.md
Last active April 16, 2025 09:14
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@prettyirrelevant
prettyirrelevant / logger.ts
Created March 18, 2021 01:23
Express JS Logging Boilerplate
import morgan, { StreamOptions } from "morgan";
import winston from "winston";
const levels = {
error: 0,
warn: 1,
info: 2,
debug: 3,
};
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active April 17, 2025 16:45
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.
@thibaud-opal
thibaud-opal / console.py
Last active November 26, 2022 11:47
Using typer with classes as commands
#!/usr/bin/env python3
from my_commands import PrintCommand
from my_lib import PrinterDriver
import os
import typer
app = typer.Typer()
myPrinter = PrinterDriver()
commands = {
@prettyirrelevant
prettyirrelevant / app.py
Last active December 6, 2024 02:55
Using Huey with Flask using application factory. For configuration, follow the djhuey format
# Due to the flexible nature of Flask. This might be __init__.py
from .extensions import huey
def create_app():
app = Flask(__name__)
# add your configurations
# app.config.from_object("settings.local")
huey.init_app(app)