Skip to content

Instantly share code, notes, and snippets.

View marisancans's full-sized avatar
🟢

Māris Ancāns marisancans

🟢
View GitHub Profile
@Vigrond
Vigrond / listlinksmixin.py
Last active May 18, 2020 18:13
A Django 2.2 Admin Mixin that supports foreign key relationship links with list_links attribute
from django.urls import reverse
from django.utils.html import format_html
class ListLinksMixin(object):
"""
Support for list_links attribute. Items in list_links must also be in list_display
Usage to make 'fieldTwo' a link:
list_display = ('fieldOne', 'fieldTwo',)
list_links = ('fieldTwo',)
@MareArts
MareArts / line_circle_rectangle_ellipse_polyline_fillConvexPoly_putText_drawContours.cpp
Last active March 26, 2024 14:34
line, circle, rectangle, ellipse, polyline, fillConvexPoly, putText, drawContours
http://cvlecture.marearts.com/2016/12/opencv-lecture-3-3_23.html
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
int main(int, char)
{
Mat img(500, 500, CV_8UC3);
@dwilkie
dwilkie / docker-cheat-sheat.md
Last active January 18, 2024 10:56
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@ericandrewlewis
ericandrewlewis / index.md
Last active November 24, 2023 14:07
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.