Skip to content

Instantly share code, notes, and snippets.

@mo-mughrabi
mo-mughrabi / faker_phone_number.py
Last active August 21, 2021 17:05
MENAPhoneNumberProvider Faker for Kuwait & Saudi Arabia Teleco Range
# a faker provider for handling generating phone numbers for Kuwait & Saudi Arabia
class MENAPhoneNumberProvider(faker.providers.BaseProvider):
""" Returns a determined list of numbers from MENA Region
*Saudi Arabia*
+966 50/53/55 XXX XXXX - Saudi Telecom Company
+966 51 XXX XXXX - Bravo Telecom (Push-to-talk Motorola)
+966 58/59 XXX XXXX - Zain Group
+966 54/56 XXX XXXX - Mobily
@mo-mughrabi
mo-mughrabi / base_django_models.py
Created June 2, 2020 10:59
A base django model for reformatted JSONFields to be disabled in admin
# This is definitely not the best approach and preferably if we can use django admin base class would be better.
# base model
import json
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.utils.safestring import mark_safe
from pygments import highlight
from pygments.formatters.html import HtmlFormatter
@mo-mughrabi
mo-mughrabi / test_django_admin_pages_listing.py
Last active June 2, 2020 10:56
Testing all admin django list pages
import pytest
from django.conf import settings
from django.urls import URLPattern, URLResolver
def _admin_urls():
""" function to return all admin urls from urlconf.urlpatterns
"""
urlconf = __import__(settings.ROOT_URLCONF, {}, {}, [""])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.