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
  • Uruguay
View GitHub Profile
# Test zope.interface to get abstract class with Python (from jupyter)
from zope.interface import Interface
from zope.interface.declarations import implementer
from PyQt5.QtCore import QObject
class Base(zope.interface.Interface, QObject):
"""My base cabstract class"""
name = zope.interface.Attribute("Base abstract class")
"""Please, let me know which child is calling me: 'parent' ? """
def read_childs(cls):
"""Return childs of cls"""
return cls.__subclasses__()
class A:
"""This is a mixin class to share code for DRY"""
@jerome-diver
jerome-diver / ipython.test
Last active May 16, 2019 05:32
error unexpected (missundertsand inherited class in python 3)
In [129]: class A:
def __init__(self, x):
super().__init__(x)
self._x = x
self._a_var = "Variable A"
@property
def a_var(self, x):
return self._a_var
class B:
@jerome-diver
jerome-diver / config.php
Created December 28, 2018 16:49
nginx-passenger with nextcloud-14 (nextcloud faile to print app/files after login with a loop)
<?php
$CONFIG = array (
'instanceid' => '[private]',
'passwordsalt' => '[private]',
'secret' => '[private]',
'trusted_domains' =>
array (
0 => 'cloud.my_domain.tk',
),
'datadirectory' => '/usr/local/www/nextcloud/data',
@jerome-diver
jerome-diver / Install.pm6
Last active July 31, 2017 04:20
Hash and Associative Hash definition and argument functions...
#----Install.pm6----
unit module Install;
use Prompt::Gruff::Export;
use Git::Wrapper;
use Check;
use Datas;
my %q = "select_groups" => "Select some groups of repos you want to install ?",
"select_repos" => "Select some repos to install: ",
"select_group" => "Choose a group from where you will install some repos: ";
@jerome-diver
jerome-diver / .tmux.conf
Created July 31, 2017 03:20
config include mouse grab actions for vim and tmux together with powerline features for zshrc and airline for vim
source /usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline_tmux_2.1_plus.conf
set -g prefix C-b
set -g default-terminal "tmux-256color"
set -g history-limit 1000
set -g mouse on
set -g set-titles on
set -g set-titles-string "#T"
setw -g monitor-activity on
set -g visual-activity on
#the sub function where error is, at line 8
our sub object_repo_exist($yaml, $object, $object_name, $group_name) is export
# $ yaml.datas contain the my.yaml parsed file. checked... exactly same structure and content of datas.
{ #give object=title|url , object_name, group_name
my $i = 0;
my %group = $yaml.datas.first: { $_<group> eq $group_name };
my %repo;
unless (%group<repos>.elems == 0) {
return True if %group<repos>.first: { $_<<$object>> eq $object_name };
}
@jerome-diver
jerome-diver / VimPlugger.pl6
Last active July 25, 2017 07:15
con not find symbol &gourp, but sub group is export(:MANDATORY) { ...}
#!/usr/bin/perl6
#use install;
use lib "/home/jerome/PROGRAMATION/Perl/Vim_plugger_6/";
use Term::Choose;
use datas;
use add :MANDATORY;
my $mode;
my $yaml = datas.new("my_pl6.yml");
my @menu0 = < List Add Modify Remove Install Uninstall Update Quit >;
@jerome-diver
jerome-diver / datas.pm6
Last active July 25, 2017 00:25
cannot import symbol EXPORT from add, because it already exists in this lexical scope
#--datas.pm---
use YAML;
class datas {
has Str $.filename is rw;
has Array @.datas;
has Str $.directory = %*ENV<HOME> ~ "/.vim/installer";
has Str $.repo_dir = %*ENV<HOME> ~ "/.vim/bundle";
has Str $.full_filename;
@jerome-diver
jerome-diver / app__assets__javascript__application.js
Last active July 12, 2017 14:05
try to make running unitegallery.js code in rails-4 application
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery2
//= require jquery.turbolinks
//= require jquery_ujs
//= require ckeditor/init
//= require jquery-ui
//= require jquery.remotipart
//= require bootstrap