Skip to content

Instantly share code, notes, and snippets.

View mvind's full-sized avatar
📈
coding

mvind

📈
coding
  • Copenhagen
View GitHub Profile
@pamelafox
pamelafox / chatreadretrieveread.py
Created November 7, 2023 20:21
Chat approach with additional function call
import json
import logging
import re
from typing import Any, AsyncGenerator, Optional, Union
import aiohttp
import openai
from azure.search.documents.aio import SearchClient
from azure.search.documents.models import QueryType
@bandeeka
bandeeka / qcnn.py
Created June 8, 2021 19:31
Quantile Convolutional Neural Network
from tensorflow.keras.layers import Input, Conv1D
from tensorflow.keras.models import Model
from tensorflow.keras import backend as K
import tensorflow as tf
NUM_UNROLLINGS = 128
NUM_EPOCHS = 1
BATCH_SIZE = 128
@smashah
smashah / peepeepoopoo.js
Last active June 26, 2020 16:39
peepeepoopoo.js
const p =['oo','ee'];
export const pp = p.slice(0).reverse().map(p=>`p${p} `.repeat(p.length).trim()).join(' ')
//"pee pee poo poo"
console.log(`p${p[1]} p${p[1]} p${p[0]} p${p[0]}`)
//"pee pee poo poo"
@BrianHung
BrianHung / Math.js
Created November 23, 2019 22:26
Math NodeView for TipTap
import {EditorState } from "prosemirror-state"
import {StepMap } from "prosemirror-transform"
import {keymap } from "prosemirror-keymap"
import {undo, redo } from "prosemirror-history"
import {EditorView } from "prosemirror-view"
import {InputRule } from "prosemirror-inputrules"
import {Node, Plugin } from 'tiptap'
import {PluginKey } from 'tiptap'
import {nodeInputRule } from 'tiptap-commands'
import {NodeSelection } from "prosemirror-state"
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active May 7, 2024 04:49
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@philippkuehn
philippkuehn / Component.vue
Created May 22, 2019 17:56
codeblock extension for tiptap using on scrumpy.io
<template>
<div class="c-code-block">
<div class="c-code-block__meta" contenteditable="false" v-if="editable">
<icon-btn
class="c-code-block__action-icon"
name="more"
:dropdown-props="{ closeOnClick: false }"
ref="icon"
>
<template v-slot:dropdown>
@tam17aki
tam17aki / MGUCell.py
Last active November 23, 2022 08:00
An implementation for MGU based on TensorFlow.
# -*- coding: utf-8 -*-
# Copyright (C) 2016 by Akira TAMAMORI
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@vitorbritto
vitorbritto / regex.md
Last active May 2, 2024 13:24
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping