Skip to content

Instantly share code, notes, and snippets.

View MoKhajavi75's full-sized avatar
:electron:

Mohamad Khajavi MoKhajavi75

:electron:
View GitHub Profile
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active April 16, 2025 09:38
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
// Link to main question ==> https://twitter.com/Loc0m0/status/1508697606716764162?s=20&t=Ziozpzj6KIznNArdT9n3xQ
const splicer = function () {
let accumulator = "";
for (let i = 1; i <= 100_000; i++) {
accumulator = accumulator + "0" + i.toString();
}
let arrayOfStrings = accumulator.split("0");
let arrayOfNumbers = arrayOfStrings.map(Number);
let result = arrayOfNumbers.reduce((sum, current) => sum + current, 0);
console.log(result);
@rezaerami
rezaerami / Cartesian-Tree.js
Last active June 20, 2021 13:55
here is an implementation of Cartesian tree in Javascript
/**
* Creates a Node with value, lett and right children properties
* @param value
* @constructor
*/
function Node(value){
this.value = value;
this.right = undefined;
this.left = undefined;
}
@sindresorhus
sindresorhus / esm-package.md
Last active April 18, 2025 01:47
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@mhmda-83
mhmda-83 / excuses.json
Last active July 26, 2024 11:35
Devloper Excuses (extracted from http://developerexcuses.com/)
[
"The program has never collected that information",
"That wasn't in the original specification",
"The project manager told me to do it that way",
"There's currently a problem with our hosting company",
"Well done, you found my easter egg!",
"That feature would be outside of the scope",
"This code was not supposed to go in to production yet",
"The client must have been hacked",
"I'm still working on that as we speak",
@rudolfschmidt
rudolfschmidt / free-3-letter-domains.sh
Created June 2, 2020 21:04
Check Free 3 Letter Domains
#!/usr/bin/env bash
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for a in "${array[@]}"
do
for b in "${array[@]}"
do
for c in "${array[@]}"
do
@carceneaux
carceneaux / remove_gitlab_artifacts.sh
Last active March 29, 2025 22:48
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@gaearon
gaearon / modern_js.md
Last active April 14, 2025 19:22
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@pmkay
pmkay / top-brew-packages.txt
Last active April 13, 2025 06:10 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles
@chusiang
chusiang / teams-chat-post-for-workflows.sh
Last active December 31, 2024 02:32
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post-for-workflows.sh
# Modified: 2024-07-22 11:44 (UTC+08:00)
# Description: Post a message to Microsoft Teams via "Post to a chat when a webhook request is received" workflows.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
# - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/