Skip to content

Instantly share code, notes, and snippets.

View SebDeclercq's full-sized avatar

Sébastien Declercq SebDeclercq

View GitHub Profile
@SebDeclercq
SebDeclercq / test.js
Created April 18, 2019 10:50
Testing to change navbar behaviour in creative-bootstrap css/js
<script>
class NavBarCustomizer {
constructor() {
this.navbar = document.querySelector('#mainNav');
this.gray = '#212529';
this.white = '#ffffff';
}
custom() {
if (! document.querySelector('.masthead')) {
if (this.navbar.classList.contains('navbar-scrolled')) {
bonjour
réinitialiser les paramètres de connexion
clic droit sur le menu démarrer
invite d commande (admin)
dans l'invite de commande tu écris ( puis entrée à chaque fois et ne pas oublier les espaces )
netsh winsock reset
netsh winhttp reset proxy
netsh winhttp reset tracing
netsh winsock reset catalog
from lxml import etree
xml = etree.parse('FA173049.xml')
for entity in xml.docinfo.internalDTD.entities():
print(f'{entity.name}.{entity.content}')
#!/usr/bin/env python3
from abc import ABC, abstractmethod
from dataclasses import dataclass
class Writer(ABC):
@abstractmethod
def write(self, text: str) -> None:
pass
@SebDeclercq
SebDeclercq / SquareDrawer.py
Created June 3, 2019 09:05
Adapted from "Think Python" exercise 3.3
from typing import Optional
class SquareDrawer:
def __init__(self, side_size: int = 5, side_amount: int = 4) -> None:
self._check_params(side_size, side_amount)
def draw_square(
self, side_size: Optional[int] = None, side_amount: Optional[int] = None
) -> None:
self._check_params(side_size, side_amount)
self._print_square_row()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from typing import Sequence, Union, List
from dataclasses import dataclass, field
import random
@dataclass
class Card:
color: str
value: Union[int, str]
AVAILABLE_COLORS: Sequence[str] = field(default=('coeur', 'pique', 'trèfle', 'carreau'), repr=False)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SebDeclercq
SebDeclercq / first_script.go
Created July 10, 2019 13:58
Golang : files, directories
//usr/bin/env go run $0 $@ ; exit
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.