Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
maksadbek /
Created Jan 19, 2022 — forked from gerrymanoim/
Code from Modern "Python Dictionaries A confluence of a dozen great ideas - Raymond Hettinger"
import array
import collections
import itertools
# Placeholder constants
FREE = -1
DUMMY = -2
class Dict(collections.MutableMapping):
'Space efficient dictionary with fast iteration and cheap resizes.'
maksadbek / lisp.cpp
Created Aug 30, 2021 — forked from ofan/lisp.cpp
Lisp interpreter in 90 lines of C++
View lisp.cpp
Lisp interpreter in 90 lines of C++
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second.
Just for fun I wondered if I could write one in C++. My goals would be
1. A Lisp interpreter that would complete Peter's test cases correctly...
2. no more than 90 lines of C++.
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake!
maksadbek /
Created Dec 12, 2020 — forked from dmmeteo/
SOLID Principles explained in Python with examples.
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
class Animal:
def __init__(self, name: str):

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?

maksadbek /
Created Feb 29, 2020 — forked from ameenkhan07/
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.


More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).


Interview is all about taking an ambiguous question of how you might build a system and letting

View pythononeliners.txt
Some useful Python one-liners taken from
All modules listed are part of the standard library and should work with Python 2.6+
How to use:
$ python -m [module] [arguments]
calendar - does default to displaying a yearly calendar, but it has a bunch of options (args are year or year month, options are HTML output, calendar locale, encoding, and some type-specific stuff, see python -m calendar -h)
cgi, dumps a bunch of information as HTML to stdout
maksadbek /
Created Mar 29, 2019 — forked from timruffles/
Chrome/Gmail attack received 11/03/2016. Not sure if the Chrome meta refresh + data:text,html technique is novel.

The following attack will display a "you've been signed out" page for GMail, and attempt to steal your account credentials.


I received an email in my GMail inbox with a fake attachment image, styled to look like the real GMail attachment UI:


This linked to a page that ended up displaying a fake "you've been signed out" link, via the data:text/html... URL feature of Chrome:

View color-theme-seamus-magit.el
;; magit stuff!!
(magit-file-header ((t (:foreground "violet"))))
(magit-hunk-header ((t (:foreground "blue"))))
(magit-header ((t (:foreground "cyan"))))
(magit-tag-label ((t (:background "blue" :foreground "orange"))))
(magit-diff-add ((t (:foreground "MediumSlateBlue"))))
(magit-diff-del ((t (:foreground "maroon"))))
(magit-item-highlight ((t (:background "#000012"))))
maksadbek /
Created Feb 15, 2019 — forked from vlucas/
Prevent Pushes Directly to Master
# @link
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
maksadbek / jupyter.service
Created Feb 15, 2019 — forked from whophil/jupyter.service
A systemd script for running a Jupyter notebook server.
View jupyter.service
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than
Description=Jupyter Notebook
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/