Skip to content

Instantly share code, notes, and snippets.

View FreePhoenix888's full-sized avatar
Empty your mind, be formless, shapeless - like water

FreePhoenix888

Empty your mind, be formless, shapeless - like water
View GitHub Profile
@FreePhoenix888
FreePhoenix888 / Описание Дипа.md
Last active November 15, 2023 06:27
Описание дипа
View Описание Дипа.md

Краткое описание

Deep это:

  • Связи
  • Пакеты, содержащие связи (сам пакет это тоже связь)
  • Обработчики вставки/обновления/удаления в любой поддерживаемой среде
  • Материализованный путь связей, деревья

Связи

@FreePhoenix888
FreePhoenix888 / gist:442a7b0735dcbc8a1cb689642d5070f1
Last active August 24, 2023 07:21
create...Decorator prototype talking
View gist:442a7b0735dcbc8a1cb689642d5070f1

Код-прототип для декоратора пакета capacitor-geolocation

import {DeepClientInstance} from '@deep-foundation/deeplinks/imports/client.js'
import { Package } from './package';

/**
 * 
 * @example
 * #### Create a decorator from another decorator
\`\`\`
View linksplatform-create-nuget-token.js
// Get your token by creating one token manually and find it in Browser Developer Tools -> Network -> GenerateApiKey -> Request
const REQUEST_VERIFICATION_TOKEN = REQUEST_VERIFICATION_TOKEN;
const packages = [
...document
.querySelector('.available-packages-container')
.querySelectorAll('input'),
].map((input) => input.parentNode.textContent.trim());
for (package of packages) {
fetch('https://www.nuget.org/account/GenerateApiKey', {
headers: {
@FreePhoenix888
FreePhoenix888 / regenerate_and_copy_nuget_tokens.js
Created November 27, 2022 17:06
Regenerate and copy nuget tokens
View regenerate_and_copy_nuget_tokens.js
const regenerateTokens = async ({ manageContainer }) => {
const regenerateTokenElements = [
...manageContainer.querySelectorAll('a'),
].filter((linkElement) => linkElement.textContent.trim() == 'Regenerate');
for (regenerateTokenElement of regenerateTokenElements) {
regenerateTokenElement.click();
}
prompt('Wait until all your keys regenerate to copy them properly');
};
@FreePhoenix888
FreePhoenix888 / regenerate_all_nuget_tokens.js
Last active November 27, 2022 16:12
Regenerate all nuget tokens
View regenerate_all_nuget_tokens.js
const manageContainer = document.querySelector("#manage-container");
const regenerateTokenElements = [...manageContainer.querySelectorAll("a")].filter(linkElement => linkElement.textContent.trim() == 'Regenerate')
for (regenerateTokenElement of regenerateTokenElements) {
regenerateTokenElement.click()
}
@FreePhoenix888
FreePhoenix888 / create-nuget-token-for-every-available-package.js
Created November 27, 2022 12:15
Create nuget token for every available package. Do not forget to select Package Owner to see available packages
View create-nuget-token-for-every-available-package.js
// Get your token by creating one token manually and find it in Browser Developer Tools -> Network -> GenerateApiKey -> Request
const REQUEST_VERIFICATION_TOKEN = REQUEST_VERIFICATION_TOKEN;
const packages = [
...document
.querySelector('.available-packages-container')
.querySelectorAll('input'),
].map((input) => input.parentNode.textContent.trim());
for (package of packages) {
fetch('https://www.nuget.org/account/GenerateApiKey', {
headers: {
View colemak_key_mappings.json
{
"layout": {
"model": "pc105",
"group": 0,
"layout": "us,ru,us",
"variant": "colemak,,",
"options": "",
"rules": "evdev"
},
"rawMapping": {
View deep-cheatsheet.md

Local

Apply a package script

export NEXT_PUBLIC_GQL_PATH=localhost:3006/gql; node package-name.cjs

Create a snapshot

cd packages/deeplinks && npm run snapshot:create && cd ../..;
View clearAnagrams.js
function aclean(arr) {
let map = new Map();
for (let word of arr) {
// разбиваем слово на буквы, сортируем и объединяем снова в строку
let sorted = word.toLowerCase().split("").sort().join(""); // (*)
map.set(sorted, word);
}
return Array.from(map.values());
View uniqueArray.js
function uniqueArray(arr) {
return Array.from(new Set(arr));
}