Skip to content

Instantly share code, notes, and snippets.


Paul Damnhorns nodkz

View GitHub Profile
View gist:94b8562661fb07d6cb67
(function($, undefined) {
* Unobtrusive scripting adapter for jQuery
* Requires jQuery 1.6.0 or later.
* Uploading file using rails.js
* =============================
nodkz / gist:ab95552a743451ec958e
Created Jul 9, 2015
Beeline в Казахстане встраивает следующий html-код на чужие сайты для пользователей IPAD на мобильном интернете. Встраивает свою рекламу, без ведома площадок.
View gist:ab95552a743451ec958e
<div id="toolbar">
<iframe id="toolBarPcFrame" src="" allowtransparency="true"
style="position: fixed; z-index: 2147483640; width: 140.4px; height: 146.4px; margin: 0px; padding: 0px; bottom: 0px; right: 0px; border: none;">
<meta name="viewport"
content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;">
<meta name="format-detection" content="telephone=no">
<style type="text/css">
nodkz / app_schema.js
Last active Mar 30, 2016
Schema configuration example for commit "Create schema2.js for getting more granular schema configuration" (
View app_schema.js
// This gist is a draft solution for extending graphQL schemas generated by graffiti.
import { getSchema, addMongooseModel, getGQType, getExistedType } from 'lib/graffiti-mongoose/src/schema/schema2';
import { User } from 'app/_schema/mongoose/user';
import { Cv } from 'app/_schema/mongoose/cv';
import { UserData } from 'app/_schema/mongoose/userData';
import ExtraFieldsWrapper from 'lib/graffiti-mongoose/src/wrappers/extra-fields';
import getFieldList from 'lib/graffiti-mongoose/src/query/projection';
nodkz / gist:bb0f4e050448225a8346cefa7077eab8
Last active Apr 11, 2016
What will return on DELETE? Null, empty or the previous object data.
View gist:bb0f4e050448225a8346cefa7077eab8
mutation {
deleteMovie(input: {clientMutationId:"123", id:"TW92aWU6NTZiODc5M2E4NzMwNzYxMjAwMGZhNWM2"}) {
changedMovie {
changedMovieEdge {
nodkz / batchRelayNetworkLayer.js
Last active Apr 21, 2016
BatchRelayNetworkLayer + ExpressWrapMiddleware
View batchRelayNetworkLayer.js
/* eslint-disable prefer-template, arrow-body-style */
import 'whatwg-fetch';
// import fetchWithRetries from 'fbjs/lib/fetchWithRetries';
class AuthError extends Error {}
* Rejects HTTP responses with a status code that is not >= 200 and < 300.
* This is done to follow the internal behavior of `fetchWithRetries`.
nodkz / compose.js
Created Jun 15, 2016
Help to annotate this function with Flow
View compose.js
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
View graphql-js-on-flow27-errors.txt
257: locations: => node.value),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call of method `map`
257: locations: => node.value),
^^^^^^^^^^ some string with unknown value. Property not found in
97: locations: Array<DirectiveLocationEnum>;
^^^^^^^^^^^^^^^^^^^^^ object literal. See: src/type/directives.js:97
258: args: makeInputValues(directiveAST.arguments),
View routes.js
import React from 'react';
import Relay from 'react-relay';
import { relayStore } from 'app/clientStores'; // relayStore = Relay.Store;
import App from 'app/_components/App/App';
import Menu from 'app/Menu/Menu';
import MainPage from 'app/MainPage/MainPage';
import Page404 from 'app/_components/Page404/Page404';
import LoadingPage from 'app/_components/LoadingPage/LoadingPage';
import BrokenPage from 'app/_components/BrokenPage/BrokenPage';
nodkz / relayStore.js
Last active Jun 29, 2017
relayStore with `reset` and simplified `mutate` methods
View relayStore.js
let relayStore;
function relayCreateStore() {
const env = new Relay.Environment();
env.injectNetworkLayer(new Relay.DefaultNetworkLayer('/graphql'));
if (__DEV__) {
env.reset = () => relayCreateStore();
env.mutate = ({
View .flowconfig