Skip to content

Instantly share code, notes, and snippets.

@homanp
homanp / worflow.json
Created September 4, 2023 11:37
Workflow
{
"success": true,
"data": {
"steps": {
"0": {
"input": "Adidas sneakers including price",
"chat_history": [
{
"content": "The solution to the equation 2*x = 5 is x = 5/2.",
"additional_kwargs": {},
@homanp
homanp / openapi.yaml
Created August 22, 2023 08:52
consensus.yaml
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
title: Detail
type: array
title: HTTPValidationError
@homanp
homanp / ai-plugin.json
Last active August 22, 2023 08:42
Consensus API
{
"schema_version": "v1",
"name_for_model": "consensus_search",
"name_for_human": "Consensus Search",
"description_for_model": "Ask a question, get conclusions from research papers. Consensus Search is a search engine that finds answers to your questions, from the common to the technical. Querying the API yields a list of claims and the research papers that support each claim.",
"description_for_human": "Get answers & insights directly from 200M+ scientific papers. To use, just ask a research question.",
"auth": {
"type": "none"
},
"api": {
@homanp
homanp / txt
Created May 20, 2023 23:19
SuperAgent terms of service
Last updated February 14, 2023
TABLE OF CONTENTS
1. AGREEMENT TO TERMS
2. INTELLECTUAL PROPERTY RIGHTS
3. USER REPRESENTATIONS
4. USER REGISTRATION
@homanp
homanp / index.js
Last active August 16, 2021 12:35
CloudAMQP Sample
'use strict';
const amqp = require('amqplib');
const QUEUE = 'pdf-generator';
module.exports = async (request, response) => {
const {projectId} = request.body;
if (!url) {

Magento 2 developer assignment

For this assignment you will have to focus on extending the Magento 2 GraphQL API.

Description

  1. Add a field to the Root Query in Magento GraphQL API called isLoggedIn. The field should return a Boolean depending on if the customer is logged in or not.

  2. Add a new configuration field in the store configuration. This field should be returned in the storeConfig Magento GraphQL query.

@homanp
homanp / .html
Created April 23, 2020 14:48
Test
<!--
## Introduction
Users today want additional control over their online experience. Additionally, publishers are faced with a variety of different demands on how they provide notice and choice to their users - from vendor policies to evolving legal requirements. The open source AMP Project is working to give publishers and tech vendors tools to implement their preferred user controls and to support their varied individual compliance requirements on their AMP pages.
This page demonstrates how a basic blocking consent flow can be built, which would just show a simple blocking popup with an accept and reject button. On reject some content in the page will be blocked.
Important: The consent is saved to localstorage - after accepting/rejecting it once you will only get the popup dialog again after deleting the localstorage content for this host, for example via [Chrome Dev Tools](https://developers.google.com/web/tools/chrome-devtools/manage-data/local-storage#local-storage).
-->
<!-- -->
<!--
## Introduction
Users today want additional control over their online experience. Additionally, publishers are faced with a variety of different demands on how they provide notice and choice to their users - from vendor policies to evolving legal requirements. The open source AMP Project is working to give publishers and tech vendors tools to implement their preferred user controls and to support their varied individual compliance requirements on their AMP pages.
This page demonstrates how a basic blocking consent flow can be built, which would just show a simple blocking popup with an accept and reject button. On reject some content in the page will be blocked.
Important: The consent is saved to localstorage - after accepting/rejecting it once you will only get the popup dialog again after deleting the localstorage content for this host, for example via [Chrome Dev Tools](https://developers.google.com/web/tools/chrome-devtools/manage-data/local-storage#local-storage).
-->
<!-- -->
<table class="specificationTable">
<tbody>
<tr>
<td></td>
<td class="specificationLabel">
<div class="landscapeIcon"></div>
<p>A5 {{translate key="Hoch"}}</p>
</td>
<td class="specificationLabel">
<div class="landscapeIcon"></div>
function start_wp_head_buffer() {
ob_start();
}
add_action('wp_head','start_wp_head_buffer',0);
function end_wp_head_buffer() {
$in = ob_get_clean();
echo $in; // output to head-tag
}
add_action('wp_head','end_wp_head_buffer', PHP_INT_MAX);