Skip to content

Instantly share code, notes, and snippets.

View ahmadina's full-sized avatar
🎯
Focusing

Ahmad ahmadina

🎯
Focusing
View GitHub Profile
@alikarimii
alikarimii / wireguardOverWebsocket.md
Last active November 7, 2024 18:00
Set Up a Wireguard VPN Server with WebSocket Tunneling

این آموزش مربوط به سیستم های یونیکسه.

CDN

خب اول یک دامنه یا ساب دامنه انتخاب کنید و یک A رکورد به مقدار آی پی سرور خارجی و پرت HTTPS بسازید.سی دی ان داخلی باشه که طرح رذالتو دور بزنید. باید روی SSL,CDN رو فعال کنید.

SSL

خب برای اون دامنه باید اس اس ال داشته باشید با این فایل ها fullchain.pem, privkey.pem, chain.pem, dhparam.pem آموزش گرفتن اس اس ال هم که زیاده. (dhparam- Diffie–Hellman (D-H))

NGINX

اول nginx رو روی سرور خارجی نصب کنید.

@arash16
arash16 / 0-blue-green-deployment.sh
Last active February 25, 2023 17:46
Sample minimal blue/green deployment strategy codes used on cafebazaar.ir
# this is a minimal sample code used for ci pipelines to implement blue/green deployment
@ewancook
ewancook / bellman_ford.go
Last active March 9, 2024 08:14
Arbitrage with Bellman Ford
package bellmanford
import (
"math"
)
// Graph represents a graph consisting of edges and vertices
type Graph struct {
edges []*Edge
vertices []uint
@anilpai
anilpai / currency_arbitrage.py
Created June 3, 2019 17:12
Currency Arbitrage using Bellman Ford Algorithm
from typing import Tuple, List
from math import log
rates = [
[1, 0.23, 0.26, 17.41],
[4.31, 1, 1.14, 75.01],
[3.79, 0.88, 1, 65.93],
[0.057, 0.013, 0.015, 1],
]
@mkhmylife
mkhmylife / laravel-k8s-configmap.yaml
Created May 3, 2019 18:31
Laravel Kubernetes Deployment files
apiVersion: v1
kind: ConfigMap
metadata:
name: backend-config
data:
APP_DEBUG: "false"
APP_ENV: production
APP_KEY: changeme
APP_LOG_LEVEL: debug
APP_NAME: "Laravel K8s"
@ImanMousavi
ImanMousavi / GenerateEthereumWallet.php
Last active November 28, 2022 06:14 — forked from onimusya/GenerateEthereumWallet.php
Generate Ethereum Wallet using PHP
<?php
require_once "vendor/autoload.php";
use Sop\CryptoTypes\Asymmetric\EC\ECPublicKey;
use Sop\CryptoTypes\Asymmetric\EC\ECPrivateKey;
use Sop\CryptoEncoding\PEM;
use kornrunner\keccak;
/**
@JohnnyWalkerDigital
JohnnyWalkerDigital / laravel_email_reset_fix.md
Last active October 11, 2022 13:18
Laravel: Setting up password reset to work as expected

Here's how set your password reset experience so that the user doesn't have to enter their email address... without altering vendor/core - tested with Laravel 5.8 (should be fine with later versions, too):

1. Create own notification

Firstly create a new notification for your app:

php artisan make:notification ResetPassword

Then open the newly created file: app\Notifications\ResetPassword.php and make the following changes:

@onimusya
onimusya / GenerateEthereumWallet.php
Last active March 27, 2022 18:58
Generate Ethereum Wallet using PHP
<?php
require_once "vendor/autoload.php";
use Sop\CryptoTypes\Asymmetric\EC\ECPublicKey;
use Sop\CryptoTypes\Asymmetric\EC\ECPrivateKey;
use Sop\CryptoEncoding\PEM;
use kornrunner\keccak;
$config = [
@paulund
paulund / AppServiceProvider.php
Last active March 16, 2023 18:10
Laravel Cache Auth::user(). Learn how to cache the logged in user at https://paulund.co.uk/laravel-cache-authuser
<?php
namespace App\Providers;
use App\Models\User;
use App\Observers\UserObserver;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
#!/bin/sh
# init. the projects informations
PROJECT=PROJECT_NAME
FILE=$PROJECT.`jdate +%Y-%m-%d`.sql
DBSERVER=DATABASE_SERVER
DATABASE=DBNAME
USER=DBUSER
PASS=dbpassword
#in case you run this more than once a day, remove the previous version of the file