Skip to content

Instantly share code, notes, and snippets.

View ahoshaiyan's full-sized avatar

Ali ahoshaiyan

View GitHub Profile
@soarez
soarez / ca.md
Last active May 28, 2024 02:57
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@homaily
homaily / gist:8672499
Last active June 2, 2024 09:06
Regex to validate saudi mobile numbers

السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .

Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .

/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/

Regex Breakdown - شرح الكود

@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@adyliu
adyliu / base62.py
Created January 9, 2013 15:55
Base62 encode/decode tools (convert number to string)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Base62 tools (convert number <=> string)
# v1.0/20130109
# python 2.x/3.x supported
#
#author: Ady Liu(imxylz@gmail.com)
#github: github.com/adyliu
import sys