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
# location: ~/.config/hypr/hyprland.conf | |
# ####################################################################################### | |
# AUTOGENERATED HYPR CONFIG. | |
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, | |
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. | |
# ####################################################################################### | |
autogenerated = 0 # remove this line to remove the warning |
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 os | |
from typing import Any, AsyncGenerator, Generator | |
from datetime import datetime | |
from alembic_utils.pg_trigger import PGTrigger | |
from alembic_utils.pg_function import PGFunction | |
from sqlalchemy import create_engine | |
from sqlalchemy import func | |
from sqlalchemy.orm import Mapped as T | |
from sqlalchemy.orm import mapped_column as column |
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
location /prefix-path { | |
rewrite ^/prefix-path/(.*)$ /$1 break; | |
# Important to prevent CORS | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
# Unexplored options | |
#proxy_set_header X-Original-URI $request_uri; # Set the modified URI in X-Original-URI header | |
#proxy_set_header X-Script-Name /prefix-path; |
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
"""Create User table | |
Revision ID: xyz | |
Revises: | |
Create Date: 2023-03-05 08:54:17.867180 | |
References: | |
1. alembic_utils API reference to create trigger: https://olirice.github.io/alembic_utils/api/ | |
2. alembic_utils usage in a migration: https://olirice.github.io/alembic_utils/examples/ |
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
CREATE TABLE table1 ( | |
id BIGSERIAL, | |
main_id int not null, | |
created TIMESTAMP DEFAULT NOW(), | |
value1 VARCHAR, | |
value2 VARCHAR, | |
value3 VARCHAR, | |
); | |
INSERT INTO table1(main_id, value1) VALUES(1, 'a'); |
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
""" | |
We can define 2 special types of strings (both consisting of lowercase English letters): | |
- two_string: string of length 2 (example: "ab","zz") | |
- three_string: string of length 3 (example: "abc","ghw") | |
You can create new strings by placing one or several two_strings and three_strings | |
side by side in a line and without placing two same strings next to one another. | |
From the example above you can create for example “abzz”, “ababc”, “zzabcghwab” etc. |
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 random | |
from collections import defaultdict | |
from pprint import pprint | |
from timeit import timeit | |
def get_configs(n=1000): | |
a2z = "abcdefghijklmnopqrstuvwxyz" | |
configs = defaultdict(set) | |
conds = set() | |
for _ in range(n): |
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
""" | |
First make sure you have the Python Image libraries installed | |
sudo pip install pillow | |
Down below you will need to define the absolute path to the images see "dir=..." | |
Run this by entering | |
python stitch.py |
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
[Trace - 06:22:39 PM] Sending request 'textDocument/documentSymbol - (64)'. | |
Params: { | |
"textDocument": { | |
"uri": "file:///home/compro/Downloads/github.com/Compro-Prasad/lisp-from-scratch/src/basic_structure.rs" | |
} | |
} | |
[Trace - 06:22:39 PM] Received response 'textDocument/documentSymbol - (64)' in 20ms. | |
Result: [ |
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
use std::collections::HashMap; | |
type Defun = fn(LispType) -> LispType; | |
#[derive(Debug, Clone, PartialEq)] | |
pub enum LispType { | |
Symbol(String), | |
Str(String), | |
RealNumber(f64), | |
LispDefun(Defun), |
NewerOlder