I hereby claim:
- I am gaganpreet on github.
- I am gaganpreet (https://keybase.io/gaganpreet) on keybase.
- I have a public key ASBjmzHuWE2w0iwNGqtMJkvaH7LPtZ9kaTSkXYe96OJmQgo
To claim this, I am signing this object:
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
chsh -s /bin/zsh |
#!/bin/sh -xe | |
INFO=$(xwininfo -frame) | |
API_KEY="KEY" | |
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+') | |
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/\+/,/' ) | |
FPS="15" | |
INRES='640x480' |
import json | |
import sys | |
import requests | |
import urllib | |
base_url = 'http://pyvideo.org' | |
class Video(): | |
title = None | |
summary = None |
import os | |
import sys | |
cwd = os.path.dirname(__file__) | |
sys.path.insert(0, os.path.realpath(os.path.join(cwd, '/path/to/django/root/'))) | |
os.environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" | |
from myapp.models import ModelA, ModelB |
123456 1911876 | |
123456789 446148 | |
password 345833 | |
12345678 201571 | |
qwerty 130828 | |
1234567 124248 | |
111111 113880 | |
123123 82689 | |
000000 76185 | |
abc123 70794 |
def optimised_pagination(query, per_page, page): | |
'''A more efficient pagination for SQLAlchemy | |
Fetch one item before offset (to know if there's a previous page) | |
Fetch one item after limit (to know if there's a next page) | |
The trade-off is that the total items are not available, but if you don't need them | |
there's no need for an extra COUNT query | |
''' | |
offset_start = (page - 1) * per_page | |
query_offset = max(offset_start - 1, 0) |
I hereby claim:
To claim this, I am signing this object:
Install this add-on: https://github.com/SchumacherFM/wordpress-to-hugo-exporter
Install Disqus on the blog and set it up. I had issues with automatic syncing the comments from Wordpress to Disqus (there were some blog posts which ended up with 0 comments), so I used the manual import. More info here: https://help.disqus.com/en/articles/1717131-importing-comments-from-wordpress
Now that your comments are on Disqus, the only thing that needs to be migrated to Hugo is the actual blog content.
Start a new Hugo project using this guide: https://gohugo.io/getting-started/quick-start/
Copy all posts from hugo export to the new post directory. You should at this point have a working blog with all the text content.
from a2wsgi import WSGIMiddleware | |
from fastapi import FastAPI | |
from fastapi.responses import ORJSONResponse, UJSONResponse | |
from flask import Flask | |
from sqlalchemy.pool import StaticPool | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy.ext.declarative import declarative_base |
from typing import Generic, TypeVar, Union, get_type_hints | |
T = TypeVar("T", bound=Union[str, int]) | |
class Base(Generic[T]): | |
value: T | |
def get_value(self) -> T: |