List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
import re | |
def get_run_sql_metadata(sql_conditions_data): | |
sql_conditions = [] | |
the_vars = {} | |
for condition in sql_conditions_data: | |
key_name = condition['key_name'] | |
value = condition['value'] | |
static_value = condition['static_value'] |
const jsonData = [ | |
{ | |
"name": "my_first_dbt_model", | |
"resource_type": "model", | |
"unique_id": "model.dbt_demo.my_first_dbt_model", | |
"depends_on": { | |
"nodes": [] | |
} | |
}, | |
{ |
import os | |
import boto3 | |
from io import BytesIO | |
from PIL import Image | |
# Initialize the S3 and Lambda clients | |
s3 = boto3.client('s3') | |
lambda_client = boto3.client('lambda') | |
def lambda_handler(event, context): |
2023-08-25 19:06:55 [scrapy.utils.log] INFO: Scrapy 2.9.0 started (bot: palscraper) | |
2023-08-25 19:06:55 [scrapy.utils.log] INFO: Versions: lxml 4.9.2.0, libxml2 2.9.13, cssselect 1.2.0, parsel 1.8.1, w3lib 2.1.1, Twisted 22.10.0, Python 3.11.2 (main, Feb 16 2023, 02:55:59) [Clang 14.0.0 (clang-1400.0.29.202)], pyOpenSSL 23.2.0 (OpenSSL 3.1.1 30 May 2023), cryptography 41.0.1, Platform macOS-13.4-arm64-arm-64bit | |
2023-08-25 19:06:55 [scrapy.crawler] INFO: Overridden settings: | |
{'BOT_NAME': 'palscraper', | |
'CONCURRENT_REQUESTS': 32, | |
'CONCURRENT_REQUESTS_PER_DOMAIN': 32, | |
'DOWNLOAD_TIMEOUT': 600, | |
'FEED_EXPORT_ENCODING': 'utf-8', | |
'LOG_FILE': 'quotes.text', | |
'NEWSPIDER_MODULE': 'palscraper.spiders', |
2023-08-25 18:58:10 [scrapy.utils.log] INFO: Scrapy 2.9.0 started (bot: palscraper) | |
2023-08-25 18:58:10 [scrapy.utils.log] INFO: Versions: lxml 4.9.2.0, libxml2 2.9.13, cssselect 1.2.0, parsel 1.8.1, w3lib 2.1.1, Twisted 22.10.0, Python 3.11.2 (main, Feb 16 2023, 02:55:59) [Clang 14.0.0 (clang-1400.0.29.202)], pyOpenSSL 23.2.0 (OpenSSL 3.1.1 30 May 2023), cryptography 41.0.1, Platform macOS-13.4-arm64-arm-64bit | |
2023-08-25 18:58:10 [scrapy.crawler] INFO: Overridden settings: | |
{'BOT_NAME': 'palscraper', | |
'CONCURRENT_REQUESTS': 32, | |
'CONCURRENT_REQUESTS_PER_DOMAIN': 32, | |
'DOWNLOAD_TIMEOUT': 600, | |
'FEED_EXPORT_ENCODING': 'utf-8', | |
'LOG_FILE': 'united.text', | |
'NEWSPIDER_MODULE': 'palscraper.spiders', |
attrs==23.1.0 | |
Automat==22.10.0 | |
certifi==2023.5.7 | |
cffi==1.15.1 | |
charset-normalizer==3.1.0 | |
click==8.1.6 | |
constantly==15.1.0 | |
cryptography==41.0.1 | |
cssselect==1.2.0 | |
docker==6.1.3 |
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |