Skip to content

Instantly share code, notes, and snippets.

@anomepani
anomepani / tutorial.md
Created July 29, 2018 14:21 — 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.

@anomepani
anomepani / data.json
Created August 16, 2018 09:57 — forked from erquhart/data.json
Staticgen.org development caching
{"BrandonRomano/static-lite":{"17550":{"size":69,"stargazers_count":25,"watchers_count":25,"forks_count":5,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":25,"network_count":5,"subscribers_count":4}},"Frozen-Flask/Frozen-Flask":{"17550":{"size":323,"stargazers_count":510,"watchers_count":510,"forks_count":47,"open_issues_count":15,"forks":47,"open_issues":15,"watchers":510,"network_count":47,"subscribers_count":18}},"tightenco/jigsaw":{"17550":{"size":1678,"stargazers_count":730,"watchers_count":730,"forks_count":84,"open_issues_count":22,"forks":84,"open_issues":22,"watchers":730,"network_count":84,"subscribers_count":34}},"JavaEden/Orchid":{"17550":{"size":19747,"stargazers_count":5,"watchers_count":5,"forks_count":2,"open_issues_count":27,"forks":2,"open_issues":27,"watchers":5,"network_count":2,"subscribers_count":1}},"wiztools/stagen":{"17550":{"size":151,"stargazers_count":38,"watchers_count":38,"forks_count":19,"open_issues_count":1,"forks":19,"open_issues":1,"watchers":38,"network_count":19
var collection=[{"category":"version control",url:"https://www.github.com"},{"category":"search engine",url:"https://www.google.com"}];
//Provide key value pair in which key is old key and value is new key(renamed key)
var newKeys={"category":"type"};
var isAllowKeyOverwrite=false;
// By default isAllowKeyOverwrite is true in utils, you can override by pssing appropriate flag
var newCollection=DTO.mapTo(collection,newKeys,isAllowKeyOverwrite);
const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')
$('h2.title').text('Hello there!')
$('h2').addClass('welcome')
$.html()
//=> <h2 class="title welcome">Hello there!</h2>
var fs = require('fs');
var cheerio = require('cheerio');
var fetch = require("node-fetch");
//const axios = require("axios");
var csharpURL = "https://www.c-sharpcorner.com/technologies";
var categoryResult = [];
//const axios = require("axios");
const getArticleCountByCategory = async(url, article) => {
/// <summary>
/// Enables the efficient, dynamic composition of query predicates.
/// </summary>
public static class PredicateBuilder
{
/// <summary>
/// Creates a predicate that evaluates to true.
/// </summary>
public static Expression<Func<T, bool>> True<T>() { return param => true; }
//Required Namespace for usage in predicate builder
using System;
using System.Data;
using System.Data.Objects;
using System.Data.Entity;
using System.Linq;
using System.Web.Mvc;
// Model class
$(document).ready(function() {
console.log("** Dom is ready **");
// Dom is now ready, Need to initialize kendo grid
// Define which columns should be visible in kendo grid
var columnOptions = [{
field: "CustomerID",
editable: false
}, {
field: "ContactName",
title: "Contact Name",
<html>
<head>
<!-- Add Kendo Grid CSS Reference-->
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.mobile.min.css" />
<link rel="stylesheet" href="style.css" />
<!-- Add Kendo Grid Js Reference -->
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jquery.min.js"></script> <!-- jszip required for export to excel-->
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jszip.min.js"></script>
var SPRest = /** @class */ (function () {
function SPRest(rootWeb) {
var _this = this;
this.Utils = (function () {
/**
* Reference or motivation link : https://github.com/omkarkhair/sp-jello/blob/master/lib/jello.js
* https://github.com/abhishekseth054/SharePoint-Rest
* https://github.com/gunjandatta/sprest
*/
var reqUrl = _this.rootUrl + "/_api/web/lists/getbytitle('AWSResponseList')/items";