Skip to content

Instantly share code, notes, and snippets.

View RStankov's full-sized avatar
🤖
👨‍💻

Radoslav Stankov RStankov

🤖
👨‍💻
View GitHub Profile
# frozen_string_literal: true
# Note(rstankov):
#
# **Don't use for `connection`s, only for `field` attributes**
#
# Preload associations.
#
# Supports all preload formats from [ActiveRecord::Base.includes](https://api.rubyonrails.org/v5.2.4/classes/ActiveRecord/QueryMethods.html#method-i-includes).
#

We are searching for Team Lead to work with product managers, designers, and engineers to shape product direction and deliver great features.

Your responsibilities will include

  • Managing and mentoring your fellow engineers
  • Collaborating closely with product and designer to ship great products
  • Driving your team roadmap, from conception to production
  • Leveraging research and usage data to iterate on these products
  • Brainstorming architecture and product decisions with the team.

How would you spend your time

module SpecSupport
module GraphHelper
def execute_mutation(current_user: nil, context: {}, **inputs)
context = Graph::Context.new(
query: OpenStruct.new(schema: YourSchema),
values: context.merge(current_user: current_user),
object: nil,
)
described_class.new(object: nil, context: context, field: nil).resolve(inputs)
end
class LoadMoreButton extends React.Component {
render() {
const { data, path, children, ...otherProps } = this.props;
return (
<button {...otherProps} onClick={this.onClick}>
{children || 'Load more'}
</button>
);
}
import { connect } from 'react-redux';
import { isFeatureEnabled } from './reducers'
function EnabledFeature({ isEnabled, children }) {
if (isEnabled) {
return children;
}
return null;
}
@RStankov
RStankov / learn.md
Last active December 11, 2020 15:28
import { ApolloClient } from 'apollo-boost';
import { get as lodashGet } from 'lodash';
interface INode<T> {
node: T;
}
interface IHaveNextPage {
pageInfo: {
hasNextPage: boolean;
import * as React from 'react';
import mitt from 'mitt';
type IEventName =
| 'CommentCreated'
| 'CommentDestroy'
type IEventPaload = any;
type IEventHandler = (payload: IEventPaload) => void;
@RStankov
RStankov / decorators.tsx
Created October 22, 2020 19:02
Draft.js Markdown
import * as React from 'react';
const BOLD_REGEX = /(^|[^\w])\*\*[^\*]+\*\*($|[^\w])/gi;
const ITALIC_REGEX = /(^|[^\w])(^|[^\*])\*[^\*]+\*($|[^\w])/gi;
const UNDERLINE_REGEX = /(^|[^\w])(^|[^\~])\~[^\~]+\~($|[^\w])/gi;
const STIKE_REGEX = /(^|[^\w])\~\~[^\~]+\~\~($|[^\w])/gi;
function boldStrategy(contentBlock: any, callback: any, _contentState: any) {
findWithRegex(BOLD_REGEX, contentBlock, callback);
}