Skip to content

Instantly share code, notes, and snippets.

@fenix-hub
fenix-hub / #description.md
Last active May 9, 2024 19:08
GDScript JSON <> Class Serializer/Deserializer

You can find usages in the GDScript Unirest plugin

This is a fast serializer/deserializer written in GDScript to convert a JSON (Dictionary) to a class, using something similar to the Reflection concecpt. json_to_class can be used to convert a Dictionary to a Class. All keys in the Dictionary will be treated as variables and their types will be guessed in the best way possible. A class (defined by the class_name keyword) must extend Reference or Object or be an inner class, or else Godot will not able to see its properties. It is also possible to deserialize a JSON key to a class property with a different name using the export hint as a variable name.

example usage:

@aamishbaloch
aamishbaloch / sign-in-with-apple.md
Created October 8, 2019 14:58
Sign In with Apple using Django (Python) Backend

Implementing Sign In with Apple in your Django (Python) backend

Apple announced a new feature, "Sign In with Apple" enabling users to sign in to apps using their Apple ID. This new feature is meant to be a secure and privacy-friendly way for users to create an account in apps. Most iOS and Mac users already have an Apple ID, and this new feature lets them use that Apple ID to sign in to other apps and websites.

Apple is taking a firm stance to protect user's privacy, rather than letting applications see the user's real email address, they will provide the app with a fake or random email address unique to each app. Don't you worry! Developers will still be able to send emails to these proxy addresses, it just means developers won't be able to use the email addresses in any other way. This feature will also allow users to disable email forwarding per application.

How it works

Apple adopted the existing standards OAuth 2.0 and OpenID Connect to use as the foundation for their new API. If you're familiar

@diasporx
diasporx / JetBrains products Activation code until 14 October 2024
Last active May 9, 2024 19:07
JetBrains products Activation code until 14 October 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25r+AIOa0u+W3peS9nOWupCAgcmVuIHpodW4gZGlhbiBtaW5n77yBIiwiYXNzaWduZWVFbWFpbCI6IlJvYmJ5X1dlbmlnZXJAb3V0bG9vay5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiREIiLCJwYWlkVXBUbyI6IjIwMjQtMTAtMTQiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJJSSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNDIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNGIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkRTIiwicGFpZFVwVG8iOiIyMDI0LTEwL
https://maps.googleapis.com/maps/api/js?key=AIzaSyAOVYRIgupAurZup5y1PRh8Ismb1A3lLao&libraries=places&callback=initMap
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 9, 2024 19:03
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
#!/usr/bin/env python3
# SOURCE: https://www.youtube.com/watch?v=xtFo1IiZqzM
import pandas as pd
from pathlib import Path
from tqdm import tqdm
fn = Path("../csv/anime_dataset/users-score-2023.csv")
@Eunovo
Eunovo / swagger.ts
Last active May 9, 2024 18:58
Creating Decorators to ease Swagger documentation
import Router from "koa-router";
export const DEFINITIONS: any = {};
let DEFINITION: any = {};
export function Definition() {
return function <T extends { new(...args: any[]): {} }>(constructor: T) {
DEFINITIONS[constructor] = {
name: constructor.name,
type: "object",
@vicrucann
vicrucann / CMakeLists.txt
Created June 14, 2016 18:08
OpenSceneGraph + QOpenGLWidget - minimal example
cmake_minimum_required(VERSION 2.8.11)
project(qtosg)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
find_package(OpenSceneGraph REQUIRED COMPONENTS osgDB osgGA osgUtil osgViewer)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
@wilmardo
wilmardo / jackett.md
Created October 29, 2019 13:08
Jackett add public indexers all in one go

Source: Jackett/Jackett#1576 (comment)

From the Jackett page, click the "add indexer" button so that the pop up window with the full list of indexers appears.

You'll then need to open your browser's development toolbar (in Chrome just hit F12) and go to the JavaScript Console and enter the following:

////hack to add all free indexers in Jackett
$(document).ready(function () {
	EnableAllUnconfiguredIndexersList();
@rponte
rponte / using-uuid-as-pk.md
Last active May 9, 2024 18:51
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes