Skip to content

Instantly share code, notes, and snippets.

Avatar

Structure and Interpretation of Computer Programs metaperl

View GitHub Profile
View gist:64779ff8cde1b1c8fe067dbc49503843
The apache2 configtest failed. ... (warning).
Output of config test was:
apache2: Syntax error on line 244 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/wsgi.load: Cannot load /usr/lib/apache2/m\
odules/mod_wsgi.so into server: /usr/lib/apache2/modules/mod_wsgi.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
View gist:3865d58654f7c8630f8665438a92ecd3
schemelab@metta:~$ sudo apt install emacs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
aptitude : Depends: libboost-iostreams1.74.0 (>= 1.74.0) but it is not going to be installed
Depends: libcwidget4 (>= 0.5.18-1) but it is not going to be installed
Depends: libxapian30 (>= 1.4.17~) but 1.4.3-2+deb9u3 is to be installed
emacs : Depends: emacs-gtk (>= 1:27.1) but it is not going to be installed or
@metaperl
metaperl / emacs-table.txt
Created Jul 8, 2021
how to get an emacs table to fill width?
View emacs-table.txt
+---------------+---------------+---------------+---------------+
| Action/Speech | Feeling Then | Feeling from List | Need |
| | | | |
+---------------+---------------+---------------+---------------+
| | | | |
+---------------+---------------+---------------+---------------+
| | | | |
+---------------+---------------+---------------+---------------+
| | | | |
View gist:8faeaf12d1a03d881be617aaea2c43e5
In GNU Emacs 27.1 (build 1, i686-w64-mingw32)
of 2020-08-21 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.19042
System Description: Microsoft Windows 10 Home (v10.0.2009.19042.1052)
@metaperl
metaperl / gist:d13f92ed82553e06ed066c61fad02426
Created Jun 29, 2021
desktop-create-buffer yields wrong-type-argument stringp nil
View gist:d13f92ed82553e06ed066c61fad02426
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
file-name-case-insensitive-p(nil)
dired-omit-case-fold-p(nil)
dired-omit-expunge()
dired-omit-mode(1)
desktop-create-buffer(208 "c:/Users/thequ/AppData/Roaming/.emacs.el" ".emacs.el" emacs-lisp-mode (eldoc-mode override-global-mode global-auto-revert-mode flx-ido-mode dired-omit-mode auto-complete-mode) 35 (1 nil) nil nil ((buffer-display-time 24790 5102 984406 0) (buffer-file-coding-system . undecided-dos)) ((mark-ring (36))))
eval-buffer(#<buffer *load*> nil "c:/Users/thequ/AppData/Roaming/.emacs.d/.emacs.des..." nil t) ; Reading at buffer position 10006
load-with-code-conversion("c:/Users/thequ/AppData/Roaming/.emacs.d/.emacs.des..." "c:/Users/thequ/AppData/Roaming/.emacs.d/.emacs.des..." t t)
load("c:/Users/thequ/AppData/Roaming/.emacs.d/.emacs.des..." t t t)
desktop-read()
@metaperl
metaperl / execution_failure.sh
Created Jul 4, 2020
Failure of execution from shell
View execution_failure.sh
(base) C:\cygwin64\home\terre\prg\import-hell-with-anaconda-python>python bin\rule_cli.py
The PYTHON PATH = ['C:\\cygwin64\\home\\terre\\prg\\import-hell-with-anaconda-python\\src', 'C:\\cygwin64\\home\\terre\\prg\\import-hell-with-anaconda-python\\bin', 'C:\\cygwin64\\home\\terre\\prg\\telegram-autotrader\\src', 'C:\\cygwin64\\home\\terre\\prg\\dwx-zeromq-connector\\v2.0.1\\python\\api', 'C:\\Users\\terre\\anaconda3\\python37.zip', 'C:\\Users\\terre\\anaconda3\\DLLs', 'C:\\Users\\terre\\anaconda3\\lib', 'C:\\Users\\terre\\anaconda3', 'C:\\Users\\terre\\anaconda3\\lib\\site-packages', 'C:\\Users\\terre\\anaconda3\\lib\\site-packages\\win32', 'C:\\Users\\terre\\anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\Users\\terre\\anaconda3\\lib\\site-packages\\Pythonwin']
Traceback (most recent call last):
File "bin\rule_cli.py", line 14, in <module>
import rule.myrule
ModuleNotFoundError: No module named 'rule.myrule'
(base) C:\cygwin64\home\terre\prg\import-hell-with-anaconda-python>
View sphinx_autodoc_suggestion.py
# Re - https://pypi.org/project/sphinx-autodoc-typehints/
# Re - https://www.reddit.com/r/Python/comments/hcc7d9/any_emerging_peps_on_unifying_type_hints_with_doc/
from typing import Union
def format_unit(
value: Union[float, int] # a numeric value,
unit: str # the unit for the value (kg, m, etc.)
) -> str:
"""
@metaperl
metaperl / documented_type_hints.py
Last active Jun 20, 2020
Should type hints and documentation for them be unified?
View documented_type_hints.py
# https://github.com/metaperl/pymt5adapter/blob/master/pymt5adapter/order.py#L104
def __init__(self,
request: dict = None, *, action: int = None, magic: int = None,
order: int = None, symbol=None, volume: float = None,
price: float = None, stoplimit: float = None, sl: float = None, tp: float = None,
deviation: int = None, type: int = None, type_filling: int = None, type_time: int = None,
expiration: int = None, comment: str = None, position: int = None, position_by: int = None,
**kwargs
):
@metaperl
metaperl / mt5_pending_order.py
Created Jun 19, 2020
Create pending orders in Python MT5 via pymt5adapter
View mt5_pending_order.py
import MetaTrader5 as mt5
import pymt5adapter
from pymt5adapter.order import Order
from pymt5adapter.symbol import Symbol
class MySymbol(Symbol):
def pips(self, amount):
return amount * 10 * self.point
View gist:3bade417454721e4ea74d921076f650e
deb http://mirrors.linode.com/debian stretch main contrib non-free
deb http://mirrors.linode.com/debian stretch-updates main contrib non-free
deb http://mirrors.linode.com/debian-security stretch/updates main contrib non-free
# deb http://httpredir.debian.org/debian stretch main contrib non-free
# deb-src http://httpredir.debian.org/debian stretch main contrib non-free
# deb http://httpredir.debian.org/debian stretch-updates main contrib non-free
# deb-src http://httpredir.debian.org/debian stretch-updates main contrib non-free