Skip to content

Instantly share code, notes, and snippets.

@Carolusian
Carolusian / README.md
Created January 24, 2024 16:38 — forked from lucianoratamero/README.md
Using Vite with Django, the simple way

Using Vite with Django, the simple way

Warning

I'm surely not maintaining this as well as I could. There are also other possible, better integrated solutions, like django-vite, so keep in mind this was supposed to be more of a note to myself than anything :]

This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.

Here's a boilerplate that uses this approach: https://github.com/labcodes/django-react-boilerplate

A couple of things to note:

@Carolusian
Carolusian / conventional-commits.md
Last active December 3, 2021 09:48 — forked from Zekfad/conventional-commits.md
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change in API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes wich doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@Carolusian
Carolusian / netcore single exe.md
Created August 13, 2021 07:18 — forked from 0xced/netcore single exe.md
Building a .NET Core single exe for Linux on macOS or Windows

Building a .NET Core single exe for Linux on macOS or Windows

Run the .NET Core SDK docker image and share your working directory containing your .csproj file at /home in the container.

On Linux/macOS:

docker run --interactive --tty --rm --volume "$(pwd):/home" mcr.microsoft.com/dotnet/core/sdk:2.2 /bin/bash

On Windows:

@Carolusian
Carolusian / part1.fs
Created August 13, 2021 07:14 — forked from mavnn/part1.fs
Introducing F# Syntax
// Let's send an email!
@Carolusian
Carolusian / GIT_SSH_COMMAND.sh
Created November 27, 2020 02:17 — forked from larryli/GIT_SSH_COMMAND.sh
Git ssh socks proxy
#!/bin/sh
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git config --global core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git clone -c=core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"' git@github.com:larryli/ipv4.git
git config core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
@Carolusian
Carolusian / merge_iterators.py
Created May 1, 2020 14:45
Merge multiple sorted iterators
from typing import List, Iterator
def merge_two_iterators(itr1: Iterator, itr2: Iterator) -> List:
"""
Merge two sorted iterators, return a list
"""
result = []
elem1, elem2 = next(itr1), next(itr2)
@Carolusian
Carolusian / Convert .mov or .MP4 to .gif.md
Created January 23, 2020 18:05 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@Carolusian
Carolusian / proxy_for_terminal.md
Created December 29, 2019 13:49 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@Carolusian
Carolusian / letsencrypt_2017.md
Last active July 1, 2019 07:19 — forked from leeoniya/letsencrypt_2017.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@Carolusian
Carolusian / docker-cleanup-resources.md
Last active March 21, 2021 06:29 — forked from bastman/docker-cleanup-resources.md
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