I think human consciousness is a tragic misstep in evolution. We became too self-aware. Nature created an aspect of nature separate from itself. We are creatures that should not exist by natural law. We are things that labor under the ilusion of having a self, this accretion of sensory experience and feeling, programmed with total assurance what we are each somebodywhen, in fact, everbody's nobody. I think the honorable thing for our species to do is deny our programming.
This file contains hidden or 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
```python | |
from PyPDF2 import PdfReader, PdfWriter | |
def extract_pages(pdf_path, start_page, end_page, output_path): | |
reader = PdfReader(pdf_path) | |
writer = PdfWriter() | |
# Page numbers are zero-indexed in PyPDF2, hence the -1 | |
for page_num in range(start_page - 1, end_page): | |
writer.add_page(reader.pages[page_num]) |
This file contains hidden or 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 time | |
def send_to_rasa(sender_id, message, rasa_server_url): | |
"""Send a message to Rasa and return the bot's response.""" | |
try: | |
response = requests.post( | |
f"{rasa_server_url}/webhooks/rest/webhook", | |
json={"sender": sender_id, "message": message, "respType": "F", "inputType": "AN", "inputKey": "", "ivrStatus": "STOPPED", "cli": "0111111111", "metadata": "bn", "va_id": "AA"} | |
) |
This file contains hidden or 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
```js | |
// const puppeteer = require('puppeteer'); | |
// async function convertWebpageToPDF(url, outputFilename) { | |
// const browser = await puppeteer.launch({ headless: "new" }); | |
// const page = await browser.newPage(); | |
// // Increase the timeout to 60 seconds (60000 milliseconds) | |
// await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 }); |
This file contains hidden or 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 enum import Enum | |
import calendar | |
class BengaliMonths(Enum): | |
January = 'জানুয়ারী' | |
February = 'ফেব্রুয়ারী' | |
March = 'মার্চ' | |
April = 'এপ্রিল' | |
May = 'মে' | |
June = 'জুন' |
This file contains hidden or 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
You can use the GitHub API to search for repositories, code, commits, issues, users, topics etc. Here is an example of how to search for repositories using Python's `requests` library. | |
```python | |
import requests | |
import json | |
def search_github(keyword): | |
url = 'https://api.github.com/search/repositories' | |
params = {'q': keyword} | |
response = requests.get(url, params=params) |
This file contains hidden or 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
# Install OpenSSL from source on Mac OS X | |
# prepare workspace | |
mkdir -p ~/code/build-from-src/ && cd $_ | |
# download source code | |
curl -LO https://www.openssl.org/source/openssl-1.1.1d.tar.gz | |
# expand tar | |
tar -xzvf openssl-1.1.1d.tar.gz |
This file contains hidden or 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
#!/bin/bash | |
if [[ "$EUID" -ne 0 ]]; then | |
echo "Please run as root." | |
exit 1 | |
fi | |
PCI_ID=$(lspci | grep "VGA compatible controller: NVIDIA Corporation" | cut -d' ' -f1) | |
#PCI_ID="0000:$PCI_ID" | |
for item in $PCI_ID | |
do | |
item="0000:$item" |
This file contains hidden or 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
absl-py==0.15.0 | |
asttokens==2.4.0 | |
astunparse==1.6.3 | |
backcall==0.2.0 | |
cachetools==5.3.1 | |
certifi==2023.7.22 | |
charset-normalizer==3.2.0 | |
clang==5.0 | |
comm==0.1.4 | |
decorator==5.1.1 |
This file contains hidden or 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
absl-py==0.13.0 | |
aio-pika==6.8.2 | |
aiofiles==23.1.0 | |
aiohttp==3.7.4 | |
aiormq==3.3.1 | |
APScheduler==3.7.0 | |
astunparse==1.6.3 | |
async-generator==1.10 | |
async-timeout==3.0.1 | |
attrs==21.2.0 |