Skip to content

Instantly share code, notes, and snippets.

View dmitry-saritasa's full-sized avatar

Dmitry Semenov dmitry-saritasa

View GitHub Profile
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
},
env: {
browser: true,
es6: true,
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
es6: true,
{ "signal": 11
, "executable": "/usr/bin/gnome-shell-extension-prefs"
, "stacktrace":
[ { "crash_thread": true
, "frames":
[ { "address": 140095114869728
, "build_id": "8aaf7d0cb428b58d6e02a03bd903d6cd1e197666"
, "build_id_offset": 1092576
, "file_name": "/lib64/libgio-2.0.so.0"
}
const JSON_SERVER = require('json-server');
const SERVER = JSON_SERVER.create();
const MIDDLEWARES = JSON_SERVER.defaults();
// YOUR SEED FILE
const seed = require('./db.json');
// if your seedfile exports a function, you should run it to get the generated json object
// in this case inside db.json we can have dynamically generated entries
@dmitry-saritasa
dmitry-saritasa / queryset_with_LatLonPoint.py
Last active August 4, 2017 23:40
proper use of LatLonPoint class in queryset
class PopularityDistanceQuerySetMixin(object):
"""Mixin when you need to add popularity, distance,
nearby calls to queryset, can be used as it for Coupon
and Merchant models
"""
def with_popularity(self):
"""Adds counted field popularity which is the value
of redeemed coupon
"""
Test in : http://graphql.org/swapi-graphql
# ---------------------------------------------
# Fragment based query
# ---------------------------------------------
query details($episode: ID, $withStarship: Boolean = false) {
film(id: $episode) {
id
title
@dmitry-saritasa
dmitry-saritasa / graphql - parameterization.js
Created June 6, 2017 22:18
GraphQL - Parameterization example
Test in : http://graphql.org/swapi-graphql
# ---------------------------------------------
# Basic query
# ---------------------------------------------
query details ($episode: ID $withStarship: Boolean = false){
film (id: $episode) {
id
title
@dmitry-saritasa
dmitry-saritasa / graphql - basic.js
Created June 6, 2017 22:13
GraphQL - Basic queries example
Test in : http://graphql.org/swapi-graphql
# ---------------------------------------------
# Basic query
# ---------------------------------------------
query all {
allFilms {
films {
@dmitry-saritasa
dmitry-saritasa / graphql - schema.js
Last active June 6, 2017 22:14
GraphQL Schema Queries
# Schema Query
{
__schema {
queryType {
name
kind
fields {
name
description
isDeprecated
@dmitry-saritasa
dmitry-saritasa / 0_reuse_code.js
Created June 6, 2017 22:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console