Skip to content

Instantly share code, notes, and snippets.

View jerome-diver's full-sized avatar
Working from home

Jérôme Lanteri jerome-diver

Working from home
  • Thailand
View GitHub Profile
jerome-diver / xmonad.desktop
Last active March 16, 2023 21:32
xmonad desktop inside /usr/share/xsessions/ directory is never see in SDDM or GDM3 display manager session WM list
View xmonad.desktop
[Desktop Entry]
Comment=Highly configurable Haskell dynamic tiling Window Manager
Keywords=Window manager
jerome-diver / actions_CRUD.js
Created August 5, 2021 00:14
Container UI design part
View actions_CRUD.js
/* CRUD for container collection to call from server API
at /api/containers address */
import { TAG, HOST, SERVER_PORT } from '../../Views/helpers/config'
const host = TAG + HOST + ":" + SERVER_PORT
const giveMe = (url, successCBK, failedCBK, finalCBK, isMounted) => {
.then( response => response.json() )
View main.lua
Test lgi Lua package with GooCanvas and Modelized items
local lgi = require 'lgi'
local Goo = lgi.GooCanvas
local Gtk = lgi.Gtk
local win = Gtk.Window { width = 640, height = 500, anchor = Gtk.GTK_WINDOW_TOPLEVEL }
local frame = Gtk.Frame { width = 400, height = 400 }
jerome-diver /
Created May 12, 2020 19:21
How super mixins can find metaclass child variable
class MixinsBuilder:
"""From child static variable, i'm going to build attributes"""
def build_attributes(self):
my_meta_var = self.???[0]
for k, v in my_meta_var:
if not hasattr(self, k):
setattr(k, v)

Keybase proof

I hereby claim:

  • I am jerome-diver on github.
  • I am jeromelanteri ( on keybase.
  • I have a public key ASDPxWjOCUODu-xi6_JBP-JaCpGhzRTPbdpmlKBnrEgergo

To claim this, I am signing this object:

jerome-diver / subprocess_out_to_json
Last active April 21, 2020 19:25
trying to get json object from command returning json through subprocess call
View subprocess_out_to_json
import json
import subprocess
# you need to have taskwarrior application installed on the Linux system to rich the shell command to return a json data
j = json.loads(["task", "status:pending", "export"], capture_output=True, check=True).stdout)
jerome-diver / custom_failure.rb
Created March 18, 2020 18:57
trying to redirect_to controller users/session action new as JS, but get back 422 error due to forgery protection
View custom_failure.rb
class CustomFailureApp < Devise::FailureApp
def redirect
message = warden.message || warden_options[:message]
puts("Messages from Warden: #{message}")
case message
when :timeout
redirect_to root_path
when :unconfirmed
redirect_to new_user_session_path(format: :js)
jerome-diver / assets.rb
Created February 10, 2020 16:31
ruby-2.7 ActionView:Template:Error (undefined method 'start_with?' for /\.(?:svg|eot|woff|ttf)\z:Regexp)
View assets.rb
Rails.apoplication.config.assets.precompile << (/\.(?:svg|eot|woff|ttf)\z)
jerome-diver / spectrwm.conf
Last active November 6, 2019 17:41
spectrwm config file
View spectrwm.conf
# NOTE: all rgb color values in this file are in hex! see XQueryColor for examples
# workspace_limit = 22
# focus_mode = default
# focus_close = previous
# focus_close_wrap = 1
# focus_default = last
# spawn_position = next
jerome-diver / try QThread list of threads managment
Last active June 7, 2019 18:32
I'm trying to manage a list of threads and from own signal emit self at end of run job, slot connected should remove thread (but it doesn't). Why ?
View try QThread list of threads managment
from PyQt5.QtCore import QObject, QThread, QSemaphore, QReadWriteLock, pyqtSignal, pyqtSlot
import random, time
class Share():
data = dict()
def __init__(self, key, value):[key] = value
def get(key):