This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prompt_kubectl() { | |
currentCluster=$(kubectx -c 2>/dev/null) | |
currentNamespace=$(kubens -c 2>/dev/null) | |
if test -n "$currentCluster"; then | |
prompt_segment yellow black "kubernetes($currentCluster:$currentNamespace)" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ go run ./main.go | |
Running .... | |
Active cluster: europe-west1-b/gke-eu | |
Grid emissions percentage: 48 | |
Active cluster: europe-west1-b/gke-eu | |
Grid emissions percentage: 48 | |
Active cluster: europe-west1-b/gke-us | |
Grid emissions percentage: 40 | |
Active cluster: europe-west1-b/gke-us | |
Grid emissions percentage: 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import requests | |
from multiprocessing import Process, Pipe | |
def downloader(url, chunk_size, conn): | |
downloaded_parts = 0 | |
with open('download', 'wb') as fp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import requests | |
chunk_size = 1024 * 1024 # 1mb | |
download_url = 'http://speedtest.ftp.otenet.gr/files/test10Mb.db' | |
downloaded_parts = 0 | |
with open('download', 'wb') as fp: | |
response = requests.get(download_url, stream=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
from datetime import datetime | |
from project_files import * | |
from git_hub_scrapper import * | |
from file import * | |
DOMAIN = 'https://github.com' | |
def main(): | |
print('[INICIO.{_date:%Y/%m/%d %H:%M:%S}]'.format(_date=datetime.now())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_depth(self): | |
parent = self.parent | |
depth = 0 | |
while parent is not None: | |
parent = parent.parent | |
depth += 1 | |
return depth | |
# coloca isso na classe Link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
""" | |
pip install requests beautifulsoup4 | |
""" | |
import requests | |
from bs4 import BeautifulSoup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Original at http://tech.yipit.com/2011/11/16/183772396/ | |
# Insert this into .git/hooks/pre-commit | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
from django.core.management import ManagementUtility | |
from django_test_runner import is_nosetest | |
from pycharm_run_utils import import_system_module | |
from teamcity import teamcity_presence_env_var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
from boto.s3.connection import S3Connection | |
from cStringIO import StringIO | |
from PIL import Image as pil | |
AWS_KEY = '[AWS KEY HERE]' |
NewerOlder