Skip to content

Instantly share code, notes, and snippets.

View patrick91's full-sized avatar

Patrick Arminio patrick91

View GitHub Profile
@matthen
matthen / hello_world.py
Last active July 1, 2024 05:08
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@ospfranco
ospfranco / WebImage.swift
Created January 16, 2022 12:44
React Native macOS Draggable SDWebImage
import Cocoa
import SDWebImage
class InternalWebImage: NSView, NSDraggingSource, NSPasteboardItemDataProvider {
let image = NSImageView()
@objc var url: NSString = "" {
didSet {
self.setupView()
}
class ExtField:
def __init__(self, node, parent=None):
self.node = node
self.parent = parent
@cached_property
def name(self) -> str:
return underscore(self.node.name.value if hasattr(self.node, "name") else "N/A")
@cached_property
@hyzyla
hyzyla / app.py
Created August 27, 2020 09:44
aiohttp + strawberry + aiodataloader example
from __future__ import annotations
from aiohttp import web
from strawberry.http import process_result
import loader
import graph
routes = web.RouteTableDef()
@AndrewIngram
AndrewIngram / pagination.py
Last active April 13, 2021 10:35
Proper cursors with Graphene + Django. Graphene-Django's stock connections use limit/offset logic under the hood, making the whole cursor-based connection modelling kinda pointless.
import datetime
import operator
from base64 import b64decode as _unbase64
from base64 import b64encode as _base64
from functools import reduce
from django.db.models import Q
from graphene import relay
from graphql_relay.connection import connectiontypes
@sbinlondon
sbinlondon / synthwaveglow.md
Last active February 22, 2024 22:40
Get the synth wave glow theme working for VS Code on Mac

Get the synth wave glow working for VS Code on Mac

These notes are pretty much the same steps as the two extensions list, it's just that I had to collate them together because neither seems to list it fully in the proper order.

  1. Install Synthwave ’84/Synthwave + Fluoromachine theme on VS Code (I used the Fluoromachine one)

  2. Install Custom CSS and JS Loader

  3. Command + Shift + P to open command palette > "Preferences: Open settings (JSON)"

@stepney141
stepney141 / BookmarkAPI_en.md
Last active April 4, 2023 01:45
(DEPRECATED) Twitter Undocumented Endpoints for Bookmark
@doctorpangloss
doctorpangloss / repetition_algorithm.ipynb
Last active November 23, 2023 19:13
Supermemo 2 Algorithm, Unobscured (Python 3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.