Skip to content

Instantly share code, notes, and snippets.

Python

On local machine

  1. Install debugpy in application virtualenv
  2. Run django server with debugpy: python -m debugpy --listen 5678 manage.py runserver --noreload 0.0.0.0:8000
  3. In neovim F5 (attach to 127.0.0.1, port 5678)

In docker container

@abidibo
abidibo / class.Image.php
Last active May 29, 2022 07:53
Image management class, php
<?php
/**
* @file class.Image.php
* @brief Contiene la classe Image per il trattamento di immagini
*
* @copyright 2014 Otto srl (http://www.opensource.org/licenses/mit-license.php) The MIT License
* @author abidibo abidibo@gmail.com
*/
define('THUMBNAIL_DIR', CONTENT_DIR.OS.'thumbnail');
@abidibo
abidibo / mselect-to-mcheckbox.css
Last active March 24, 2021 13:40
Library to substitute the multiple select widget with a multiple checkbox in django admin
.mcheckbox-container {
display: inline-block;
vertical-align: middle;
height: 160px;
overflow: auto;
}
.mcheckbox-table {
margin-right: 20px;
width: 100%;
}
@abidibo
abidibo / FPJS.md
Last active November 26, 2020 14:13
FP

FP in JS

Imperative VS Declarative

Imperative: tell the program how to do stuff, how the control flow goes and how the state changes. Declarative: tell the program what the logic is, describe the problem.

Declarative programs, specifically functional ones, raise the level of abstraction by using a minimally structured flow made up of independent blackbox operations that connect in a simple topology. These connected operations are nothing more than higher-order functions that move state from one operation to the next.

Example: quicksort algorithm

@abidibo
abidibo / gist:a5dae11a05c4ea22d526c00801f507d3
Created June 5, 2019 10:26
Material about memcached and kubernetes
https://karrier.io/blog/memcached-on-kubernetes/
https://stackoverflow.com/questions/50180560/memcache-on-kubernetes
https://www.kubestack.com/catalog/memcached-v0.2.1-kbst.2/documentation
@abidibo
abidibo / ngrxintro.md
Last active April 10, 2018 13:33 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@abidibo
abidibo / PyQt.md
Last active March 14, 2018 11:56
PyQt Stuff

PyQt5 Stuff

i18n

Install the following package

$ sudo apt-get install pyqt5-dev-tools

In my case it was also necessary to install this other package to use linguist command

@abidibo
abidibo / code-plugins.vim
Last active October 23, 2017 15:10
A vim configuration model
" Indentation
Plug 'Yggdroot/indentLine'
" folding
Plug 'Konfekt/FastFold'
" pairs
Plug 'jiangmiao/auto-pairs'
" commentary
@abidibo
abidibo / vim-conf.md
Created October 20, 2017 12:46
Vim conf stuff
@abidibo
abidibo / rope.md
Last active October 20, 2017 10:47
ROpe stuff for vim

Rope stuff

By default you can use <Ctrl-Space> for autocompletion

Autocompletion is also called by typing a period in |Insert| mode by default.

By default when you press <C-C>g on any object in your code you will be moved to definition.

Pymode can rename everything: classes, functions, modules, packages, methods, variables and keyword arguments.