Skip to content

Instantly share code, notes, and snippets.

View hsul4n's full-sized avatar

Huthaifah Mustafa hsul4n

View GitHub Profile
@Waseem-Almoliky
Waseem-Almoliky / Yemeni phone number regex.md
Last active July 30, 2023 19:26
yemeni phone numbers regex

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

yemeni phone number regex

Hello

this is a regex code to validate yemeni phone number for private companies and ground lines almost everything :) hope you found it useful.

/^(((\+|00)9677|0?7)[01378]\d{7}|((\+|00)967|0)[1-7]\d{6})$/
@josecanhelp
josecanhelp / meilisearch-forge.md
Last active March 21, 2024 14:39
Install MeiliSearch on Forge servers

Although MeiliSearch offers steps to install via apt, there are some dependency libraries that are not installable on the server architecture we have availble on our Tighten Forge servers. However, the servers can run the program just fine with the binary. Here are the steps I took to make it work.

Download the stable release

curl -L https://install.meilisearch.com | sh

Change the ownership and modify permissions

chmod 755 meilisearch chown root:root meilisearch

Move the binary to a system-wide available path

@Mosallamy
Mosallamy / Arabic-Wkhtmltopdf.sh
Last active September 24, 2023 10:56
Wkhtmltopdf - Arabic PDF differs between Mac and Linux
#When I deployed my Flask HTML/CSS to PDF application on Ubuntu server, Wkhtmltopdf rendered the same PDF with different #styles.
#The Ubuntu version rendered:
# 1- long Arabic text in one line without wrapping the text
# 2- the CSS alignment was not accurate
# 3- black header was auto generated
#The solution was to uninstall the current version of Wkhtmltopdf and install Wkhtmltopdf With Patched QT Setup.
#---------------------------- Steps:
#---------------------------- A- Unistall Wkhtmltopdf:
@przbadu
przbadu / _vue-rails.md
Last active July 16, 2022 21:48
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@talnetd
talnetd / crud.c
Created February 12, 2015 15:59
Simple CRUD in C to understand how one connect to DATABASE
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#define MAX_DATA 512
#define MAX_ROWS 100
struct Address {
@vitorbritto
vitorbritto / rm_mysql.md
Last active June 29, 2024 20:26
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@neatshell
neatshell / myscript
Last active May 31, 2024 14:19
simple bash template that handles mandatory and optional arguments
#!/bin/bash
script="myscript"
#Declare the number of mandatory args
margs=2
# Common functions - BEGIN
function example {
echo -e "example: $script -m0 VAL -m1 VAL -o1 -o2 VAL"
}
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end