Skip to content

Instantly share code, notes, and snippets.

View movahhedi's full-sized avatar
💻
Coding, probably.

Shahab Movahhedi movahhedi

💻
Coding, probably.
View GitHub Profile
@einari
einari / LetsEncryptCertbotTLS.sh
Created November 23, 2022 08:56
Script for creating a Lets Encrypt certificate using Certbot and then exporting to .pfx file
#!/bin/bash
sudo certbot \
certonly \
--server https://acme-v02.api.letsencrypt.org/directory \
--manual \
--agree-tos \
--preferred-challenges dns \
--register-unsafely-without-email \
-d *.domain. # Wildcard - could be regular and one can also specify multiple -d options to include in the certificate
@movahhedi
movahhedi / SmsIr.php
Last active June 7, 2023 13:11
SMS.IR Full PHP Class
<?php
/**
* @author Shahab Movahhedi <[email protected]>
* @copyright © 2022 Shahab Movahhedi. All rights reserved.
* @link http://sms.ir/ Documentation of sms.ir RESTful API PHP sample.
* @version 1.2
*/
class SmsIr {
@daviesesiro
daviesesiro / image-resize.js
Last active June 27, 2024 01:05
a minimal function to resize an image on the browser in JavaScript
/**
* Resizes an Image File and converts it to a dataurl string.
* @param imageFile the image file (probably from a file input)
* @param resize_width The width you want the image to be
* @param quality quality of the resize image 0 - 1
*/
const resizeImage = ({
resizeWidth = 400,
imageFile,
quality = 1,
@aleclarson
aleclarson / rollup-typescript.md
Last active November 4, 2024 15:40
The best Rollup config for TypeScript libraries

It's 2024. You should use tsup instead of this.


Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking

@anuraghazra
anuraghazra / Exclude-node_modules.md
Last active January 9, 2024 20:00
Exclude node_modules folder when copying directory.

Handy Trick To Get Rid Of node_modules

This one is a simple and handy trick when you want to copy your directories without node_modules folder.

Enter this command in your terminal.

robocopy SOURCE DEST /mir /xd node_modules
@LoganGray
LoganGray / chromeinstall_ubu16.sh
Last active June 6, 2023 14:35
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04, 20.04.1 LTS desktop, Jan 2021
# also tested and works on Elem OS 5.1 :)
#
# make sure script is run as root or sudo
if [[ $(whoami) != "root" ]] ; then
echo ; echo "This script, $0, SHOULD be run as ROOT. " ; echo
exit 1
fi
#
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active November 16, 2024 18:27
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@Oranzh
Oranzh / AES-256 encryption and decryption in PHP and C#.md
Created March 24, 2018 04:19
AES-256 encryption and decryption in PHP and C#

AES-256 encryption and decryption in PHP and C#

Update: There is a more secure version available. Details

PHP

<?php

$plaintext = 'My secret message 1234';