Skip to content

Instantly share code, notes, and snippets.

View channaveer's full-sized avatar

Channaveer Hakari channaveer

View GitHub Profile

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

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@sdgluck
sdgluck / query.js
Last active April 23, 2024 17:48
Pagination using Mongo: populate, match, sort, count, and limit with the aggregation pipeline
/**
* Query blog posts by user -> paginated results and a total count.
* @param userId {ObjectId} ID of user to retrieve blog posts for
* @param startRow {Number} First row to return in results
* @param endRow {Number} Last row to return in results
* @param [filter] {Object} Optional extra matching query object
* @param [sort] {Object} Optional sort query object
* @returns {Object} Object -> `{ rows, count }`
*/
function queryBlogPostsByUser (userId, startRow, endRow, filter = {}, sort = false) {
@thomasvs
thomasvs / mysql_replication_autostart.sh
Created October 16, 2016 01:31 — forked from nicomak/mysql_replication_autostart.sh
This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes. More details on how it works at http://blog.ditullio.fr/2016/04/30/initialize-mysql-master-slave-replication-script/
#!/bin/bash
#title : replication-start.sh
#description : This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes.
#author : Nicolas Di Tullio
#date : 20160706
#version : 0.2
#usage : bash mysql_replication_autostart.sh
#bash_version : 4.3.11(1)-release
#=============================================================================
@vasanthk
vasanthk / System Design.md
Last active May 3, 2024 16:37
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 26, 2024 19:09
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@denji
denji / nginx-tuning.md
Last active May 3, 2024 03:57
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})