Skip to content

Instantly share code, notes, and snippets.

View Abdelkrim's full-sized avatar

Abdelkrim from Brussels Abdelkrim

View GitHub Profile
@Abdelkrim
Abdelkrim / git-publish-more-than-one-repository.sh
Last active April 30, 2020 13:29
git: move project from one repository to another one (bitbucket, github, gitlab)
# copy a repository and its tags into a second, third repositoty
# (c) Abdelkrim Boujraf, http://www.alt-f1.be
# Imagine that your original repository is on bitbucket.org
[email protected]:alt-f1.be/data_visualization.git
# ADD REMOTE PUSH URL's for gitlab and github
# It will change the remote.origin.pushurl config entry.
# Now pushes will send to both of these destinations, rather than the fetch URL.
# https://gist.github.com/rvl/c3f156e117e22a25f242
@Abdelkrim
Abdelkrim / InheritedWidgetSample.dart
Created May 10, 2020 23:46
Flutter, inherited widget understood from a Inherited Widgets Explained - Flutter Widgets 101 Ep. 3 on YouTube
// see https://www.youtube.com/watch?v=Zbm3hjPjQMk
import 'package:flutter/material.dart';
class InheritedSettings extends InheritedWidget{
final SettingsSwitchesStatefulWidget settingsSwitchesStatefulWidget;
final TechnicalInfoSection technicalInfoSection;
InheritedSettings({this.SettingsSwitchesStatefulWidget, Widget child}): super(child: child);
@Abdelkrim
Abdelkrim / delete_files_from_kaggle_working_directory.py
Created May 20, 2020 11:01
remove files from kaggle directory : '/kaggle/working/'
# Author Abdelkrim Boujraf, ALT-F1 SPRL
import os
dir_to_delete = '/kaggle/working/'
with os.scandir(dir_to_delete) as entries:
for entry in entries:
file_to_delete = f"{dir_to_delete}{entry.name}"
if os.path.isfile(file_to_delete):
print(file_to_delete)
os.remove(file_to_delete)
@Abdelkrim
Abdelkrim / certbot_create_self_certificate_and_pem_to_pfx.sh
Created May 29, 2021 15:36
use certbot to generate a self signed certificate and convert a .pem into .pfx
#!/bin/bash
# https://dev.to/ope/securing-your-azure-web-app-with-let-s-encrypt-4g99
echo please indicate the domaine name i.e. alt-f1.be
read domain_name
# domain_name=betterop.alt-f1.be
sudo certbot certonly -d $domain_name --manual --preferred-challenges dns
@Abdelkrim
Abdelkrim / remove-venv-pycache-directories.py
Last active June 29, 2024 13:18
Python script removing venv directories on Windows & Linux and, __pycahce__ directories
import os
import shutil
def is_venv_directory(path):
"""
Check if the given path is a virtual environment directory.
"""
return (
os.path.isdir(path) and
(os.path.isfile(os.path.join(path, 'bin', 'activate')) or
@Abdelkrim
Abdelkrim / gist:7e1e326d7246786e75d842608aa1a7d8
Created June 29, 2024 15:42
delete venv, __pycache__, .next directories
import os
import shutil
def is_venv_directory(path):
"""
Check if the given path is a virtual environment directory.
"""
return (
os.path.isdir(path) and
(os.path.isfile(os.path.join(path, 'bin', 'activate')) or