This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Route handler for GET hello | |
* | |
* @param { import("gadget-server").RouteContext } request context - Everything for handling this route, like the api client, Fastify request, Fastify reply, etc. More on effect context: https://docs.gadget.dev/guides/extending-with-code#effect-context | |
* | |
* @see {@link https://www.fastify.io/docs/latest/Reference/Request} | |
* @see {@link https://www.fastify.io/docs/latest/Reference/Reply} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductAdminForm(forms.ModelForm): | |
def __init__(self, *args, **kwargs) -> None: | |
super().__init__(*args, **kwargs) | |
if self.instance.pk: | |
self.fields["option1"].queryset = self.instance.options.all() | |
class Meta: | |
model = Product | |
fields = "__all__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shopify | |
from django.core.management.base import BaseCommand | |
from console.models import AuthAppShopUser | |
class Command(BaseCommand): | |
def add_arguments(self, parser): | |
parser.add_argument( | |
"myshopify_domain", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rate limiting with Python RQ + Django + Redis | |
# Multiple Fixed Windows Algorithm inspired by Figma https://www.figma.com/blog/an-alternative-approach-to-rate-limiting/ | |
import functools | |
from typing import Callable | |
import django_rq | |
from rq import Retry | |
from django.utils import timezone | |
from datetime import timedelta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import BackgroundTasks, FastAPI | |
import aiohttp | |
import asyncio | |
app = FastAPI() | |
async def send_request(): | |
async with aiohttp.ClientSession() as session: | |
async with session.get("https://httpdump.io/") as response: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "Business number", | |
"states": [ | |
{ | |
"name": "Trigger", | |
"type": "trigger", | |
"transitions": [ | |
{ | |
"event": "incomingMessage" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/snippets/ajax-cart-template.liquid b/snippets/ajax-cart-template.liquid | |
index 7f820eb..d49ebee 100644 | |
--- a/snippets/ajax-cart-template.liquid | |
+++ b/snippets/ajax-cart-template.liquid | |
@@ -26,14 +26,16 @@ Use the raw liquid tags to keep the handlebar.js template tags as available hook | |
</ul> | |
<div class="cart-bottom"> | |
<div class="buttons-container"> | |
- <a href="/cart" class="minicart-button">{% endraw %}{{ 'cart.general.view_cart' | t }}{% raw %}</a> | |
+ <a href="/cart" class="minicart-button" style="width: 100%;">{% endraw %}{{ 'cart.general.view_cart' | t }}{% raw %}</a> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#define PIN 1 | |
#define WAIT 40 | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800); | |
void setup() { | |
strip.begin(); | |
strip.setBrightness(255); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#define PIN 1 | |
#define WAIT 40 | |
// pouzivame knihovnu Adafruit_NeoPixel pro komunikaci s diodou | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800); | |
void setup() { | |
// Zakladni nastaveni diody |
NewerOlder