Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
add_action( 'graphql_register_types', function() { | |
register_graphql_field( 'Hashtag', 'hashtagImg', [ | |
'type' => 'String', | |
'description' => __( 'The image (URL) for a topic.', 'wp-graphql' ), | |
'resolve' => function( \WP_Term $term ) { | |
$topic_meta = get_term_meta( $term->id, '_topic_image', true ); | |
$img_post = wp_get_attachment_url( $topic_meta ); | |
return ! empty( $img_post ) ? $img_post : null; |
import React, { Component } from 'react'; | |
import 'whatwg-fetch'; | |
import MediumEditor from 'medium-editor'; | |
import Citation from './citation.js'; | |
class BookCitation extends Component { | |
constructor( props ) { | |
super( props ) | |
this.state = { |
import graphene | |
class Query(graphene.ObjectType): | |
hello = graphene.String(name=graphene.Argument( | |
graphene.String, default_value="stranger"), age=graphene.Argument(graphene.Int)) | |
def resolve_hello(self, args, context, info): | |
return 'Hello {} you are {} years old'.format(args['name'], args['age']) | |
def main(): |
from graphene import ObjectType, String, Field, Int | |
# Schema Objects | |
class CitationObject(ObjectType): | |
title = String() | |
oclc = Int() | |
language = String() | |
publisher = String() | |
city = String() | |
publish_year = Int() |
const withPlugins = require('next-compose-plugins'); | |
const withTM = require('next-plugin-transpile-modules'); | |
const withOptimizedImages = require('next-optimized-images'); | |
const withFonts = require('next-fonts'); | |
const withCSS = require('@zeit/next-css'); | |
module.exports = withPlugins( | |
[ | |
[ | |
withTM, |
/* | |
You would call this when receiving a plain text | |
value back from an API, and before inserting the | |
text into the `contenteditable` area on a page. | |
*/ | |
define(function(require) { | |
'use strict'; | |
/* | |
Used to convert text with line breaks |
Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
/* Facebook */ | |
:root, .__fb-light-mode { | |
--fds-active-icon: #3578E5; | |
--fds-attachment-footer-background: #F2F3F5; | |
--fds-black: #000000; | |
--fds-black-alpha-05: rgba(0, 0, 0, 0.05); | |
--fds-black-alpha-10: rgba(0, 0, 0, 0.1); | |
--fds-black-alpha-15: rgba(0, 0, 0, 0.15); | |
--fds-black-alpha-20: rgba(0, 0, 0, 0.2); | |
--fds-black-alpha-30: rgba(0, 0, 0, 0.3); |
| |
@using Microsoft.AspNetCore.Authentication; | |
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | |
@model Pikcha.Services.Auth.Identity.API.Models.AccountViewModels.AuthenticationViewModel | |
@{ | |
var returnUrl = ViewData["ReturnUrl"]; | |
var externalLoigns = (IList<AuthenticationScheme>)ViewData["ExternalLogins"]; | |
var page = ViewData["Page"] ?? "register"; |