Skip to content

Instantly share code, notes, and snippets.

View benselme's full-sized avatar

Béranger Enselme benselme

  • Montréal, Québec
View GitHub Profile
@benselme
benselme / install-podman-linux-mint-21.md
Created March 20, 2023 18:47
How to install latest podman version in linux mint 21

This installs the latest podman version on a Linux Mint 21 system, using OpenSuse's kubic project's repositories.

mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key   | gpg --dearmor   | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_22.04/ /"   | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
apt update
apt install podman
@benselme
benselme / babel_icu_test.py
Created May 27, 2017 01:08
testing babel vs icu number formatting
def test_number_pattern_spec_examples():
pattern = u'@@@'
assert numbers.format_decimal(12345, pattern) == u'12300'
assert numbers.format_decimal(0.12345, pattern) == u'0.123'
assert numbers.format_decimal(3.14159, u'@@##') == u'3.142'
assert numbers.format_decimal(1.23004, u'@@##') == u'1.23'
SCIENTIFICSTYLE = 3
@benselme
benselme / tree.py
Last active July 22, 2024 08:40
SQLAlchemy ordered tree with postgresql recursive CTE
# -*- encoding: utf-8 -*-
from sqlalchemy import (Column, Integer, ForeignKey, String, create_engine,
literal, null, type_coerce)
from sqlalchemy.dialects.postgresql import array, ARRAY
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session, aliased
Base = declarative_base()
@benselme
benselme / select2_selenium.py
Last active August 19, 2019 04:02
Simple helper class to use Select2 controls with Selenium Webdriver
from selenium.webdriver import ActionChains
class Select2(object):
def __init__(self, element):
self.browser = element.parent
self.replaced_element = element
self.element = browser.find_element_by_id(
's2id_{0}'.format(element.get_attribute('id')))
def click(self):