Skip to content

Instantly share code, notes, and snippets.

View usulpro's full-sized avatar
🟢

Oleg Proskurin usulpro

🟢
View GitHub Profile
// view at: https://stackblitz.com/edit/vitejs-vite-8s3guc?file=src%2FEditor.tsx&terminal=dev
import React, { useRef, useEffect } from 'react';
import { EditorView, ViewUpdate } from '@codemirror/view';
import { EditorState, Extension } from '@codemirror/state';
import { basicSetup } from '@codemirror/basic-setup';
import { javascript } from '@codemirror/lang-javascript';
import { oneDark } from '@codemirror/theme-one-dark';
interface EditorProps {
value?: string;
@Qix-
Qix- / ohai.gif
Last active October 16, 2023 16:04
ohaider
ohai.gif
input CreatePost {
imageUrl: String!
title: String!
}
type Mutation {
createPost(imageUrl: String!, title: String!): Post
updatePost(id: ID!, imageUrl: String, title: String): Post
updateOrCreatePost(update: UpdatePost!, create: CreatePost!): Post
deletePost(id: ID!): Post
@okonet
okonet / lightning_talk_proposal.md
Last active April 10, 2018 10:09
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.

Decorator / addon preview API proposal.

Currently the principal way addons work in the preview context (ie acting on the story) is via decorators.

Types of decorator

There are 3 types of thing that the decorators do:

  • Altering the story in a very real way: "modifiers"
  • Inspecting the story, and sending telemetry somewhere (typically to the manager context via the addon channel): "inspectors"
@sebmarkbage
sebmarkbage / API.js
Last active August 11, 2020 04:03
Custom Stack Frames
type FrameScope = {
[key:string]: mixed
};
type StackFrame = {
name?: string,
fileName?: string,
lineNumber?: number,
columnNumber?: number,
scope?: FrameScope
};
@kof
kof / confirm-linkedin-skills.js
Last active July 8, 2017 10:20
Confirm all skills at linkedin
var expander = document.querySelector('[data-control-name="skill_details"][aria-expanded="false"]')
if (expander) expander.click()
;[].slice.apply(document.querySelectorAll('button[data-control-name="endorse"]')).forEach((btn) => {
btn.click()
})