Skip to content

Instantly share code, notes, and snippets.

View Geekfish's full-sized avatar
🐝
... 🐝 ... 🐝 ... 🐝 ... 🐝

Eleni Lixourioti Geekfish

🐝
... 🐝 ... 🐝 ... 🐝 ... 🐝
View GitHub Profile
@PJUllrich
PJUllrich / big-o.md
Last active March 18, 2024 14:44
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@syxanash
syxanash / Pizza Recipe.md
Last active March 27, 2024 12:01
My Pizza Recipe

Pizza Recipe

pizza recipe

Hi I'm Simone! This recipe was developed based on some tips I acquired over time from lots and lots of resources and tutorials like youtube videos, family and friends recipes. I'm just an amateur who likes making pizza :)

If you plan to perfectionate your pizza making skills, I suggest to come up with your own recipe and research online watching lots of tutorials and different techniques. For now the following recipe is the one that works for me!

(I'm not a professional pizzaiolo and I never had any sort of experience in a professional pizzeria restaurant)

Ingredients and quantities

@djm
djm / README.md
Last active September 21, 2017 09:33
Triggering Opbeat errors from Python RQ Workers

Introduction

To get rq workers talking to opbeat at this current time, you must use a custom rq exception handler and add it to the chain that the worker accepts. This allows us to call opbeat synchronously and avoid the current issues with the opbeat library's async workers.

Both of the examples below keep the original rq exception handler functionality of moving a failed job to the failed queue, but this is optional - if you only want opbeat logging then just don't pass the move_to_failed_queue handler.

Note that we send a lot of extra information about the job itself (see _get_job_details) but this is not a requirement, the stack you get is useful enough without it.

With django-rq (>=0.9.5)

@webframp
webframp / keybase.md
Created July 25, 2017 18:14
Signing git commits on github using keybase.io gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

@coreyhaines
coreyhaines / Editable.elm
Last active August 25, 2022 05:11
type Editable
module Editable exposing (..)
type Editable ofType
= NotEditing { value : ofType }
| Editing { originalValue : ofType, buffer : ofType }
value : Editable ofType -> ofType
value editable =
@coreyhaines
coreyhaines / Flow.elm
Last active December 14, 2020 00:20
General workflow-management
module Flow exposing (Flow(..), map, withDefault, mapDefault, view, update)
import Html
type Flow state
= NotRunning
| Running state
https://github.com/tomchristie/django-rest-framework/issues/1936
https://github.com/tomchristie/django-rest-framework/issues/1891
https://github.com/tomchristie/django-rest-framework/issues/1860
https://github.com/tomchristie/django-rest-framework/issues/1767
https://github.com/tomchristie/django-rest-framework/issues/1649
https://github.com/tomchristie/django-rest-framework/issues/1338
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@amatellanes
amatellanes / celery.sh
Last active April 19, 2024 11:31
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@eerien
eerien / forms.py
Last active February 2, 2023 23:12
Comma Separated Values Form Field for Django. There are CommaSeparatedCharField, CommaSeparatedIntegerField.
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
class MinLengthValidator(validators.MinLengthValidator):
message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).'
class MaxLengthValidator(validators.MaxLengthValidator):
message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).'