Skip to content

Instantly share code, notes, and snippets.

View enimiste's full-sized avatar

NOUNI El bachir enimiste

View GitHub Profile
@enimiste
enimiste / How to update a pull request.md
Created October 6, 2025 08:01
How to update a pull request ?

How to update a pull request ?

you don't need hub to update pull requests. Pull requests are tied to the remote branch they're opened from (the pull-request "head"). Just push to that branch again and GitHub will automatically figure it out. You can even force-push, of you need that.

What if you accidentally have removed the remote branch that is linked to the PR? Is it possible to fetch the PR and link it to a new remote on your fork, so the PR can be updated? Asking for a friend...

So to update a PR, even if you have removed the original remote branch out of which the PR was created, you just need to:

  • Fetch the PR (git fetch pull//head:branchname and git checkout branchname).
  • Add new commits, amend, rebase, do whatever you like.
  • Push or push force (git push remote +branch).

And after that the PR will be automagically updated :)

@enimiste
enimiste / memo-node-gyp.txt
Created January 7, 2025 20:20
Tips to use with nodejs v12 when getting errors with GYP
npm install -g node-gyp
export npm_config_node_gyp=/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
rm -rf node_modules(if already there)
npm install
# Source : https://github.com/nodejs/node-gyp/issues/2144#issuecomment-703856503
@enimiste
enimiste / docker-compose.yml
Last active April 23, 2024 20:44
Kafka cluster docker-compose config
# This file contains two config and it can't be runned
# You should keep only one config (Single node or HA version)
# Single node
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.4.4
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@enimiste
enimiste / heat_transmission.js
Last active April 10, 2024 20:51
Simulation of heat transmission
/*
<html>
<head>
<meta charset="utf-8"/>
</head>
<body style="border-color: #edecec3b;">
<div>
<h2 id="title">Game</h2>
<canvas style="border: 1px solid gray;" data-size="900"></canvas>
<br/>
@enimiste
enimiste / Dockerfile
Last active November 26, 2023 10:44
Docker file for run scala dev env (latest java and scala versions)
FROM mcr.microsoft.com/devcontainers/base:jammy
USER vscode
RUN curl -s "https://get.sdkman.io" | bash
RUN chmod +x "$HOME/.sdkman/bin/sdkman-init.sh"
RUN "$HOME/.sdkman/bin/sdkman-init.sh"
# Java Env
@enimiste
enimiste / watch_tests_files.py
Last active November 8, 2023 23:29
Run continuously running test files on changes
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import os
import sys
from os import path
import re
"""
Requirements :
@enimiste
enimiste / game_of_life_console.py
Created November 4, 2023 22:05
Runnable Console Version of Game of Life
# Coderetreat @2023 - Arolla
# vivant + <=1 voisin ----> Meurt
# vivant + >=4 voisins ----> Meurt
# vivant + {2, 3} voisins ----> Conserve son statut
# vide + 3 voisins ----> Survit
# Business
# Il nous a demandé de modéliser la grille :
# - en gardant uniquement les cellules vivantes
# - rille sans bornes
@enimiste
enimiste / test_gameoflife_iter4.py
Created November 4, 2023 16:22
Gameoflife - Coderetreat @2023 - Arolla
# Coderetreat @2023 - Arolla
# Authors : NEB + AMEH
# vivant + <=1 voisin ----> Meurt
# vivant + >=4 voisins ----> Meurt
# vivant + {2, 3} voisins ----> Conserve son statut
# vide + 3 voisins ----> Survit
# Business
NEXT_STATE = {
0: (lambda _ : 0),
@enimiste
enimiste / test_gameoflife_iter5.py
Last active November 4, 2023 20:32
Gameoflife - Coderetreat @2023 - Arolla
# Coderetreat @2023 - Arolla
# Authors : NEB + AMEH
# vivant + <=1 voisin ----> Meurt
# vivant + >=4 voisins ----> Meurt
# vivant + {2, 3} voisins ----> Conserve son statut
# vide + 3 voisins ----> Survit
# Business
# Il nous a demandé de modéliser la grille :
# - en gardant uniquement les cellules vivantes
@enimiste
enimiste / SensorsSolution.java
Created October 23, 2023 12:54
AtCoder.jp problem - Sensors Solution
import java.util.*;
import java.lang.*;
public class Main {
record XY(int x, int y){}
public static void main(final String[] args) throws Exception {
//Variables
int H=0, W=0;
int[][] grid=null;
//Read inputs