Skip to content

Instantly share code, notes, and snippets.

@piotr-dobrogost
piotr-dobrogost / custom-log-filtering-and-formatting.py
Created January 21, 2019 14:31 — forked from acdha/custom-log-filtering-and-formatting.py
Example of how to filter or apply custom formatting using Python's logging library
#!/usr/bin/env python
# encoding: utf-8
from pprint import pformat, pprint
import logging
class PasswordMaskingFilter(logging.Filter):
"""Demonstrate how to filter sensitive data:"""
@piotr-dobrogost
piotr-dobrogost / angularjs_directive_attribute_explanation.md
Created January 16, 2019 08:24 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@piotr-dobrogost
piotr-dobrogost / dropbox
Created October 18, 2017 20:35 — forked from thisismitch/dropbox
Dropbox systemd and init files (CentOS 7)
#!/bin/sh
# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
# Source function library.
. /etc/rc.d/init.d/functions
prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
@piotr-dobrogost
piotr-dobrogost / tmux.cheat
Created June 28, 2017 06:21 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
from gevent import monkey
monkey.patch_all()
import gevent
import requests
def http_req(x, url):
r = requests.post(url)
print "Request ", x, r