Skip to content

Instantly share code, notes, and snippets.

@RGGH
RGGH / rust-xp-02-postgresql-sqlx.rs
Created March 31, 2023 18:13 — forked from jeremychone/rust-xp-02-postgresql-sqlx.rs
Rust to PostgreSQL with SQLX | Rust By Example
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use sqlx::postgres::{PgPoolOptions, PgRow};
use sqlx::{FromRow, Row};
// Youtube episode: https://youtu.be/VuVOyUbFSI0
// region: Section
// Start postgresql server docker image:
@dotja
dotja / nginx-https.md
Last active January 20, 2024 07:03
Configure Nginx with HTTPS

Nginx/HTTPS Configuration

About

HTTPS is when HTTP (hypertext transfer protocol); a communication protocol, is encrypted using TLS (transport layer security).

This means that if anyone is eavesdropping on the communication between a server and a client, they will eavesdrop on encrypted data that is hard to decipher and is therefore secure.

TLS is the more recent term which replaces the term SSL (secure socket layer) but we can refer to them as SSL/TLS.

@RGGH
RGGH / Scrapy-tables
Created June 7, 2021 12:28 — forked from dray89/Scrapy-tables
How to scrape tables using Scrapy
import scrapy
import pandas
from ..items import YahooItem
class YahooSpider(scrapy.Spider):
name = 'Yahoo'
symbols = ["ADSK","BA","CAT","EBAY","GS","HSY","IBM","JPM","WMT","SHOP",
"T", "F", "TRI", "AMZN", "C", "A", "O", "B","MSFT", "NVDA",
"DIS", "AAL", "NFLX", "JNJ","BAC","GOOGL", "WFC"]
start_urls = ['https://finance.yahoo.com/quote/{0}/history?p={0}'.format(x) for x in symbols]
@GenevieveBuckley
GenevieveBuckley / test_monkeypatch.py
Last active December 12, 2023 18:57
Monkeypatching user input with pytest
from io import StringIO
def double():
x = input("Enter an integer: ")
return int(x) * 2
def adding():
x = float(input('Enter the first number'))
@umangahuja1
umangahuja1 / run python file without typing python and extension.md
Last active September 4, 2023 13:31
How to run python files without typing python and extension

How to run python files without typing python and extension (in Linux)

Steps to follow to run your python code without typing python filename.py.

You can simply run by typing filename if you follow these simple steps.

Step 1 : Add shebang line as first line in your python code

@anton-petrov
anton-petrov / recaptcha.py
Created September 24, 2017 19:11
Solve reCAPTCHA with Selenium + Python
import re, csv
from time import sleep, time
from random import uniform, randint
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException