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
SPACESHIP_PROMPT_ORDER=( | |
battery | |
user | |
conda | |
aws | |
package | |
docker | |
node | |
ruby | |
elixir |
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 urllib.parse import urljoin | |
import urllib3 | |
from urllib3.exceptions import HTTPError | |
def response_ok(func): | |
def validate(*args, **kwargs): | |
result = func(*args, **kwargs) | |
if result.status != 200: |
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
// Required only nodejs | |
const { performance } = require('perf_hooks'); | |
const obj = { | |
get memoizedGetter() { | |
delete this.memoizedGetter; | |
return this.memoizedGetter = [...Array(5e+7).keys()].reduce((prev, num) => prev + num, 0); | |
}, | |
get commonGetter() { | |
return [...Array(5e+7).keys()].reduce((prev, num) => prev + num, 0); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" | |
name="viewport"> | |
<meta content="ie=edge" http-equiv="X-UA-Compatible"> | |
<title>Document</title> | |
<style> | |
div.image-box { |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Infinite Scrolling 🤞</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css"> | |
<style> |
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
import requests | |
import logging | |
from requests.exceptions import ReadTimeout, ConnectionError | |
logger = logging.getLogger(__name__) | |
url = 'https://www.google.com:81' | |
data = { 'username': 'DoonDoony', 'address': '...' } | |
retries = 3 |
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
import sys | |
import logging | |
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) | |
class logger: | |
def __init__(self, function): | |
self.function = function | |
self.logger = logging.getLogger(__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
# 💡 NOTE: This only works if you are pretend to using `Django Console` feature in Pycharm | |
# Paste codes below into `Build, Execution, Deployment > Console > Django Console > Starting Script` | |
# requirements: `django_extensions`, `IPython` | |
import sys | |
import django | |
from IPython.core.getipython import get_ipython | |
from django_extensions.management.notebook_extension import load_ipython_extension |
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 | |
from __future__ import print_function | |
import re | |
import sys | |
GIT_HEAD_REF = '.git/HEAD' | |
ticket_number = re.compile(r'\b[A-Z]{2,}-[0-9]+') | |
branch_ticket_number = re.compile(r'\b[a-z]{2,}-[0-9]+') |
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
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
mail_content = 'Hi there!' | |
sender_address = "mailer@example.com" | |
sender_password = "very_secret_password" | |
receiver_address = "kind.person@example.com" |
OlderNewer