Skip to content

Instantly share code, notes, and snippets.

View turtiesio's full-sized avatar
😃

David Hwang turtiesio

😃
View GitHub Profile
@infomiho
infomiho / 0-README.md
Last active May 8, 2024 08:19
Using ShadCN with Wasp 0.12+

Using ShadCN with Wasp 0.12 and beyond

Note

We'll be loosly following the Vite instructions for ShadCN since Wasp is using Vite + React: https://ui.shadcn.com/docs/installation/vite We'll skip some of the steps since they don't apply or they are done differently with Wasp.

We'll skip the @ alias setup since it's not currently supported by Wasp. Because of this you'll need to adjust some imports when we generate components, but it should be fairly straightforward to do.

1. Enable TailwindCSS if you haven't already

@kekru
kekru / 01nginx-tls-sni.md
Last active May 6, 2024 14:59
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@npearce
npearce / install-docker.md
Last active May 17, 2024 12:03
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@hhanh00
hhanh00 / reverse-ws-proxy.js
Created June 24, 2015 15:05
Reverse Proxy for websockets using Express JS
var http = require('http'),
httpProxy = require('http-proxy'),
express = require('express');
// create a server
var app = express();
var proxy = httpProxy.createProxyServer({ target: 'http://localhost:8080', ws: true });
var server = require('http').createServer(app);
// proxy HTTP GET / POST
@magopian
magopian / Makefile
Created November 15, 2012 11:02
Sample Makefile for Django (use with project templates)
.PHONY: all help translate test clean update compass collect rebuild
SETTINGS={{ project_name }}.settings
TEST_SETTINGS={{ project_name }}.test_settings
# target: all - Default target. Does nothing.
all:
@echo "Hello $(LOGNAME), nothing to do by default"
@echo "Try 'make help'"
@ibeex
ibeex / auth.py
Created October 14, 2011 20:04
Python LDAP (ActiveDirectory) authentication
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
"""
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%s@xxx.xx' % username