Skip to content

Instantly share code, notes, and snippets.

View redstrike's full-sized avatar

Tung Nguyen redstrike

  • Da Nang, Vietnam
  • 21:46 (UTC +07:00)
  • X @v2r_red
View GitHub Profile
@redstrike
redstrike / git.cs
Created December 12, 2024 09:11 — forked from davidfowl/git.cs
Sample schema for git add, clone, commit, clean
using System;
using System.Collections.Generic;
using CliWrap;
namespace GitCLIWrapper;
public static class Git
{
public static Command Clone(
string repository,
@redstrike
redstrike / nodejs-optimization-flags.md
Last active March 24, 2023 04:21 — forked from stormwild/node.md
Node.js Optimization Flags
@redstrike
redstrike / websocket-network-tweak.md
Created March 23, 2023 13:40 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@redstrike
redstrike / .unit.conf.json
Created May 8, 2022 22:12 — forked from nginx-gists/.unit.conf.json
Building Application Stacks With NGINX Unit
{
"listeners": {
"*:8080": {
"pass": "routes/wordpress"
}
},
"routes": {
"wordpress": [
{
"match": {
@redstrike
redstrike / ubuntu_install.sh
Created May 8, 2022 22:10 — forked from nginx-gists/ubuntu_install.sh
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"

Laravel alternatives in NodeJS

These are alternative packages/frameworks in NodeJS that cover some of the primary features in Laravel. This is by no means a comprehensive list of Laravel features (or a comprehensive list of NodeJS alternatives).

Depending on your perspective, this list either shows how it's possible to switch from Laravel to NodeJS or shows why you'd want to stay with Laravel 😃


Full stack framework alternatives: Nest, Adonis

@redstrike
redstrike / async-defer-module.md
Created February 19, 2022 11:32 — forked from jakub-g/async-defer-module.md
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@redstrike
redstrike / MinimalAPIs.md
Created September 16, 2021 04:27 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@redstrike
redstrike / begin(C++).md
Created August 30, 2021 16:16 — forked from johnmcfarlane/begin(C++).md
Resources for C++ beginners
@redstrike
redstrike / Commit Formatting.md
Created July 20, 2021 03:01 — forked from clemtibs/Commit Formatting.md
Angular Commit Format Reference Sheet

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject: