Skip to content

Instantly share code, notes, and snippets.

View kanchansapkota27's full-sized avatar
🎯
Focusing

Kanchan Sapkota kanchansapkota27

🎯
Focusing
  • Atlanta,Georgia,USA
  • 08:05 (UTC -04:00)
View GitHub Profile
@charles-l
charles-l / save_page.py
Last active March 2, 2024 19:57
A python script to save the Firefox Reader view of a page with images. Kind of a personal archive.org tool but using zip and HTML files rather than WARC.
#!/usr/bin/env python3
from bs4 import BeautifulSoup
from readability import Document
import click
from click import echo
import requests
import slugify
import os
@toransahu
toransahu / models.py
Last active May 5, 2023 14:04
Writable Nested Serializers | Multiple Images Upload | DRF
#!/usr/bin/env python3.6.4
# coding="UTF-8"
__author__ = 'Toran Sahu <[email protected]>'
__copyright__ = 'Copyright (C) 2018 Ethereal Machines Pvt. Ltd. All rights reserved'
from django.db import models
from os import path
from utils import directory_path_with_id
@samukasmk
samukasmk / django_select_distinct_count_anotate.py
Created April 25, 2016 21:30
Django example of SELECT Distinct Count by values
# Model example
class Person(models.model):
...
country = moldels.CharField(...)
# Select counting by values of field country
>>> Person.objects.all().values("country").annotate(total=Count("country"))
>>> [
{
"country": "Brasil",
@ceolson01
ceolson01 / mixins.py
Created March 19, 2016 15:05
Django Group Required Mixin
from django.core.exceptions import PermissionDenied
class GroupRequiredMixin(object):
"""
group_required - list of strings, required param
"""
group_required = None
@aculich
aculich / wikipedia-infoboxes-in-pandas.ipynb
Last active March 21, 2024 04:51
How to extract Wikipedia infoboxes and wikitables using Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrkline
mrkline / c_sharp_for_python.md
Last active August 1, 2025 17:59
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,