Skip to content

Instantly share code, notes, and snippets.

View SebDeclercq's full-sized avatar

Sébastien Declercq SebDeclercq

View GitHub Profile
@SebDeclercq
SebDeclercq / Pipfile
Last active November 19, 2019 09:09
Simple OO Flask App
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
mypy = "*"
black = "*"
flake8 = "*"
<html>
<body>
<table>
<thead>
<td>A</td>
<td>B</td>
<td>C</td>
</thead>
<tbody>
@SebDeclercq
SebDeclercq / python.json
Last active October 25, 2024 09:00
My vscode python snippets + config
{
"f-string": {
"prefix": "fs",
"body": "f'$0'",
},
"print('')": {
"prefix": "p",
"body": "print('$0')"
},
"print(f'')": {
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output
method="xml"
encoding="UTF-8"
indent="yes"/>
<xsl:template name="ola" match="/">
@SebDeclercq
SebDeclercq / ex1.py
Last active September 21, 2019 06:28
def func(l):
return sorted(l, key=lambda num: sum(int(i) for i in str(num)))
print(func((98, 98, 97, 96, 95, 96, 1, 1, 2, 2)))
print(func((98, 19, 4321, 9999, 73, 241, 111111, 563, 33)))
from pathlib import Path
from typing import List
import asyncio
import time
class DirScanner:
'''Directory scanner'''
async def scan(self, dirname: str) -> List[Path]:
package kata
import (
"sort"
"strings"
"strconv"
)
func MaxRot(n int64) int64 {
ints := strings.Split(strconv.FormatInt(n, 10), "")
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.