Skip to content

Instantly share code, notes, and snippets.

View srugano's full-sized avatar
😀
I may be slow to respond.

Allan Stockman RUGANO srugano

😀
I may be slow to respond.
View GitHub Profile
@raphaelm
raphaelm / storage.py
Created March 20, 2018 21:08
NanoCDN Storage driver
import hashlib
import urllib.parse
import os
from io import BytesIO, StringIO
import requests
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File
@hakib
hakib / custom_django_checks.py
Last active July 5, 2025 13:06
Custom django checks using Django check framework, inspect and ast.
"""
Custom django checks.
H001: Field has no verbose name.
H002: Verbose name should use gettext.
H003: Words in verbose name must be all upper case or all lower case.
H004: Help text should use gettext.
H005: Model must define class Meta.
H006: Model has no verbose name.
H007: Model has no verbose name plural.
@tanaikech
tanaikech / submit.md
Last active May 15, 2025 12:47
Uploading Multiple Files From Local To Google Drive using Google Apps Script

Uploading Multiple Files From Local To Google Drive using Google Apps Script

This is a sample script for uploading multiple files from local PC to Google Drive using Google Apps Script. The dialog, sidebar and Web Apps can be used as the GUI interface.

Sample 1

In this sample, the following flow is run.

  1. Select files at browser.
  2. Upload the files every file.
  3. Save each file in Google Drive.
@srugano
srugano / playbook.yml
Created January 13, 2019 15:19 — forked from marklit/playbook.yml
Setup a load-balanced, two-node Django cluster
---
- name: SSH tightening
hosts: all
sudo: True
tasks:
- name: Disable root's ssh account
action: >
lineinfile
dest=/etc/ssh/sshd_config
@davemerwin
davemerwin / DJANGO-HTMX Class Based View Request Grab to Change Templates
Last active June 15, 2024 18:07
An example of a Class Based View using django-htmx to determine what template to return
class AddImage(LoginRequiredMixin, CreateView):
"""
adds a image
"""
form_class = ImageForm
model = Image
def get_template_names(self):
if self.request.htmx: