This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#----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: "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$CONFIG = array ( | |
'instanceid' => '[private]', | |
'passwordsalt' => '[private]', | |
'secret' => '[private]', | |
'trusted_domains' => | |
array ( | |
0 => 'cloud.my_domain.tk', | |
), | |
'datadirectory' => '/usr/local/www/nextcloud/data', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5.QtCore import QObject, QThread, QSemaphore, QReadWriteLock, pyqtSignal, pyqtSlot | |
import random, time | |
class Share(): | |
data = dict() | |
def __init__(self, key, value): | |
Share.data[key] = value | |
@staticmethod | |
def get(key): | |
return Share.data[key] | |
@staticmethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PLEASE READ THE MAN PAGE BEFORE EDITING THIS FILE! | |
# https://htmlpreview.github.io/?https://github.com/conformal/spectrwm/blob/master/spectrwm.html | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.apoplication.config.assets.precompile << (/\.(?:svg|eot|woff|ttf)\z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomFailureApp < Devise::FailureApp | |
def redirect | |
store_location! | |
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(subprocess.run(["task", "status:pending", "export"], capture_output=True, check=True).stdout) |