NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
# this lives in superset_config.py | |
class AirbnbAuthRemoteUserView(AuthRemoteUserView): | |
def add_role_if_missing(self, sm, user_id, role_name): | |
found_role = sm.find_role(role_name) | |
session = sm.get_session | |
user = session.query(sm.user_model).get(user_id) | |
if found_role and found_role not in user.roles: | |
user.roles += [found_role] | |
session.commit() |
var landGrid = [ | |
{ | |
"X": "1", | |
"Y": "1" | |
}, | |
{ | |
"X": "1", | |
"Y": "2" | |
}, | |
{ |
import requests | |
import logging | |
import httplib | |
# Debug logging | |
httplib.HTTPConnection.debuglevel = 1 | |
logging.basicConfig() | |
logging.getLogger().setLevel(logging.DEBUG) | |
req_log = logging.getLogger('requests.packages.urllib3') | |
req_log.setLevel(logging.DEBUG) |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
# coding=UTF-8 | |
from __future__ import division | |
import nltk | |
from collections import Counter | |
# This is a simple tool for adding automatic hashtags into an article title | |
# Created by Shlomi Babluki | |
# Sep, 2013 |
This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.
var landGrid = [ | |
{ | |
"X": "1", | |
"Y": "1" | |
}, | |
{ | |
"X": "1", | |
"Y": "2" | |
}, | |
{ |
from collections import deque | |
from functools import wraps | |
def inversify(predicate): | |
"""Returns a predicate that is the inverses of the given predicate.""" | |
@wraps(predicate) | |
def _inner(*args, **kwargs): | |
return not predicate(*args, **kwargs) | |
return _inner |