This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def naive_way_of_sorting(arr): | |
for i in range(len(arr)): | |
for j in range(i+1, len(arr)): | |
if arr[i] > arr[j]: | |
arr[i], arr[j] = arr[j], arr[i] | |
return arr | |
def test_sorting(size): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = "blah blah" | |
t = araby.strip_tashkeel(t) #remove tashkeel | |
t = re.sub(r'([-؟،.!;:])', ' \\1 ', t) #add spaces between special charaacters | |
t = re.sub(r'([^\s\w\-؟،.!;:])+', '', t) #remove all special characters except some | |
t = re.sub(r'[³ـ¼]', '', t) #explecitly remove some special characters | |
t = re.sub('[a-zA-z]', '', t) #remove english litters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: ensure ufw installed | |
apt: name=ufw update_cache=true | |
- name: ufw deny incoming | |
ufw: | |
direction: incoming |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiFormMixin(ContextMixin): | |
form_classes = {} | |
prefixes = {} | |
success_urls = {} | |
grouped_forms = {} | |
initial = {} | |
prefix = None | |
success_url = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2016 Stuart Powers | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |