Skip to content

Instantly share code, notes, and snippets.

View richardcornish's full-sized avatar

Richard Cornish richardcornish

View GitHub Profile
@mhsamiei
mhsamiei / gonicorn_nginx_django.md
Last active September 26, 2024 13:44
deploy django with nginx and gunicorn config

Testing Gunicorn’s Ability to Serve the Project The last thing we want to do before leaving our virtual environment is test Gunicorn to make sure that it can serve the application. We can do this by entering our project directory and using gunicorn to load the project’s WSGI module:

    (myenv) $ cd ~/myprojectdir
    (myenv) $ gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Creating systemd Socket and Service Files for Gunicorn We have tested that Gunicorn can interact with our Django application, but we should implement a more robust way of starting and stopping the application server. To accomplish this, we’ll make systemd service and socket files.

@dannysteenman
dannysteenman / Text Substitutions.plist
Created July 16, 2020 19:59
macOS emoji text replacements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>👎</string>
<key>shortcut</key>
<string>:-1:</string>
</dict>
@Sauerstoffdioxid
Sauerstoffdioxid / googleurlparams.md
Last active October 13, 2024 13:30
Google/Blogger Image URL Parameters

Google/Blogger Image URL Parameters

This is an effort to document what is known about Google's (Blogger's/Blogspot's) image URL parameters. Some of these options were taken from existing first or third party documentation (see the links at the end of this document), but the majority is based off my own investigations.

Where to use them?

  • On Blogger's image URL's: 2.bp.blogspot.com/-OF7u67HQE1M/VHc8S8qJTDI/AAAAAAAACxI/UD-11c63diQ/s1600/005.png
  • On just about any googleusercontent image URL: https://lh3.googleusercontent.com/Jvmz11cLrvNIHG_LWjVO9B-UV2IN4Cfk1pycbhWZl6IriMgCAGCOFuBRtoHaiZ6xeVGqCugZcCql=w176-h176-n-o

Replace the bolded parts with the parameters.

@veltman
veltman / README.md
Last active April 19, 2023 16:32
Generating an SVG from a set of shapefiles

Generating an SVG from a set of shapefiles

The USGS provides detailed downloads of fire perimeters, with timestamped files that can be used to show the spread of a major fire over time.

Using the 2017 Thomas fire as an example, we'll process this data into a single SVG file with all the different perimeter measurements.

This index page contains links to a series of shapefiles of the fire boundary, each one with a timestamp:

https://rmgsc.cr.usgs.gov/outgoing/GeoMAC/2017_fire_data/California/Thomas/

Setting up RetroArch on Raspberry Pi 4 and building emulator cores

Guide for myself and others to get RetroArch running on the new Raspberry Pi 4 while projects like RetroPie get an image out for the rpi4.
Disclaimer: I am not an expert and this may not be the most optimal build possible, but it works.

Inspiration taken from:

@hkamran80
hkamran80 / SmartTV2.txt
Last active October 31, 2024 03:01
Pi-hole Blocklist for Smart TVs
# THIS FILE IS NO LONGER BEING MAINTAINED. FOR A MAINTAINED VERSION, PLEASE USE THE VERSION IN THE NEW REPOSITORY.
# Repository: https://github.com/hkamran80/blocklists
# New link for this file: https://raw.githubusercontent.com/hkamran80/blocklists/main/smart-tv
# ------
# This is a blocklist to block Smart TVs sending data home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
@rchrd2
rchrd2 / models.py
Last active February 14, 2022 08:15
Django object manager with Haversine distance annotation method (aka filter by distance with mysql)
from django.db import models
from with_distance_manager import WithDistanceManager
class Foo(models.Model):
longitude = models.DecimalField(max_digits=19, decimal_places=10, null=True)
latitude = models.DecimalField(max_digits=19, decimal_places=10, null=True)
objects = WithDistanceManager()
@JamoCA
JamoCA / Comment-Spam-Email-Addresses.txt
Last active September 25, 2024 15:13
A list of email addresses (or domains when the username is randomized) that are actively blocked using our internal feedback form and/or comment spam filters. Updated regularly. Last Updated: 2024-08-23 (When comparing, sanitize gmail addresses to remove dots & + https://gist.github.com/JamoCA/6f46af76a3f8b9975ccc0623602a92f1 )
@30secondexplainervideos.com
@3dAnimatedVideos.com
@5cvirtualsolutions.com
@7roars.agency
@90secondexplainervideos.com
@accurate.com
@acquimail.com
@adamfortrade.com
@adkarma.com
@advancefunding.xyz
@dannguyen
dannguyen / faa-333-pdf-gathering.md
Last active June 19, 2021 13:18
Using wget + grep to explore inconveniently organized federal data (FAA Section 333 Exemptions)

if !database: wget + grep

The Federal Aviation Administration is posting PDFs of the Section 333 exemptions that it grants, i.e. the exemptions for operators who want to fly drones commercially before the FAA finishes its rulemaking. A journalist wanted to look for exemptions granted to operators in a given U.S. state. But the FAA doesn't appear to have an easy-to-read data file to use and doesn't otherwise list exemptions by location of operator.

However, since their exemptions page is just one giant HTML table for listing the PDFs, we can just use wget to fetch all the PDFs, run pdftotext on each file, and then [grep](https://medium.com/@rualthanzauva/grep-was-a-private-command-of-m