Skip to content

Instantly share code, notes, and snippets.

View lozybean's full-sized avatar

Lyon0804 lozybean

View GitHub Profile
@pirafrank
pirafrank / .lftp.mockup.rc
Created December 10, 2016 12:05 — forked from gaubert/.lftp.mockup.rc
~/.lftp.rc parameters detailed
########## SETTINGS
# On startup, lftp executes ~/.lftprc and ~/.lftp/rc. You can place aliases and 'set' commands
# there. Some people prefer to see full protocol debug, use 'debug' to turn the debug on.
# Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is time amount
# (floating point) and x is time unit: d - days, h - hours, m - minutes, s - seconds. Default unit is second. E.g.
# 5h30m or 5.5h. Also the interval can be 'infinity', 'inf', 'never', 'forever' - it means infinite interval. E.g.
# 'sleep forever' or 'set dns:cache-expire never'.
@Lapin0t
Lapin0t / mongodb_match.py
Last active July 9, 2018 10:44
mongoDB-style json querying in python
from functools import reduce
import re
_TYPES = {'string': str, 'int': int, 'object': dict, 'array': list,
'bool': bool, 'null': type(None)}
_OPS = {'$eq': lambda s, d: s == d,
'$gt': lambda s, d: d > s,
'$gte': lambda s, d: d >= s,