Skip to content

Instantly share code, notes, and snippets.

@spzm
spzm / serializer.py
Created December 16, 2019 22:43 — forked from quozd/serializer.py
Typehints-based deserializer
def _create_config_hierarchy(config_cls: Type[TConfig], config_data: Mapping) -> TConfig:
sig = signature(config_cls)
cls_data_attributes = getmembers(config_cls, lambda a: isinstance(a, GenericDescriptor))
if len(cls_data_attributes) != len(sig.parameters):
raise TypeError(
'Type {type_name} has invalid __init__.\n'
'Init parameters count should equal to data descriptors count.\n'
'Init parameters: [{init_params}], data descriptors: [{data_descriptors}]'.format(
from rasa_nlu.featurizers import Featurizer
import tensorflow_hub as hub
import tensorflow as tf
class UniversalSentenceEncoderFeaturizer(Featurizer):
"""Appends a universal sentence encoding to the message's text_features."""
# URL of the TensorFlow Hub Module
@spzm
spzm / tutorial.md
Created July 17, 2018 21:06 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

{-# LANGUAGE NamedFieldPuns #-}
module Filter where
import Prelude hiding (floor)
import qualified Prelude
import Predicate
data Bezirk
@spzm
spzm / nodejs-fatal-flow.md
Created February 26, 2018 18:12 — forked from obenjiro/nodejs-fatal-flow.md
Фатальный недостаток Node.js
@spzm
spzm / lazy.js
Created January 27, 2018 14:40 — forked from kana/lazy.js
Lazy evaluation in JavaScript
function delay(expressionAsFunction) {
var result;
var isEvaluated = false;
return function () {
if (!isEvaluated)
result = expressionAsFunction();
return result;
};
}
@spzm
spzm / Enhance.js
Created June 26, 2017 12:21 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@spzm
spzm / introrx.md
Created June 6, 2017 21:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@spzm
spzm / react-reusable-component.md
Created January 29, 2017 23:26 — forked from ericelliott/react-reusable-component.md
React - Complete Reusable Component

React Reusable Component Factory

'use strict';

const ENTER_KEY = 13;

const emailFactory = function ({
  React,
  setEmail,
@spzm
spzm / final-projects.md
Created July 13, 2016 10:18 — forked from aorgish/final-projects.md
Темы финального проекта для тренинга Rolling Scopes

#Темы финальных проектов Основное требование к финальным проектам - это небольшое SPA (Single Page Application) веб-приложение с опрятным и чистым дизайном. Желательно использование фреймворков типа React или Angular. Должна быть либо серверная часть на nodejs, либо использованы сторонние API и веб-сервисы для получения данных, то есть или свой или сторонний бекенд, чтобы попрактиковать ajax-запросы. Если бекенд свой, то в идеале его можно разместить на бесплатном клауд-хостинге (https://www.heroku.com/, https://www.firebase.com, https://www.openshift.com и тд), если нужна база mongodb то можно воспользоваться бесплатным вариантом на https://mlab.com/.

Ниже примерные типовые приложения, которые можно взять за основу, если нет своих идей. Картинки даны для примера дизайна, делать похожим один в один необязательно. Дизайн типичных приложений можно подсмотреть в google images.

##Calendar ![Календарь](http://winsupersite.com/content/content/143